public OnPlayerConnect ( playerid ){ TextDrawShowForPlayer ( playerid, texdraw1 ); TextDrawShowForPlayer ( playerid, texdraw2 ); TextDrawShowForPlayer ( playerid, texdraw3 ); return 1;}OnPlayerCommandText ( playerid, cmdtext [ ] ){ if ( strcmp ( cmdtext, \"/textdraw\", true ) == 0 ) { new i_str [ 4 ]; i_str = strtok ( cmdtext, idx ); if ( !strlen ( i_str ) ) return SendClientMessage ( playerid, 0xFFFFFF, \"Használat: /textdraw [ ON -OFF]\" ); else if ( strcmp ( i_str,\"on\", true ) == 0 ) { TextDrawShowForPlayer ( playerid, textdraw1 ); TextDrawShowForPlayer ( playerid, textdraw2 ); TextDrawShowForPlayer ( playerid, textdraw3 ); return 1; } else if ( strcmp ( i_str,\"off\",true ) == 0 ) { TextDrawHideForPlayer ( playerid, textdraw1 ); TextDrawHideForPlayer ( playerid, textdraw2 ); TextDrawHideForPlayer ( playerid, textdraw3 ); return 1; } return 1; } return 0;}
töltsd le a dini include-t
strtok(const string[], &index){new length = strlen(string);while ((index < length) && (string[index] <= \' \')){index++;}new offset = index;new result[20];while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1))){result[index - offset] = string[index];index++;}result[index - offset] = EOS;return result;}
public OnPlayerConnect ( playerid ){ TextDrawShowForPlayer ( playerid, texdraw1 ); TextDrawShowForPlayer ( playerid, texdraw2 ); TextDrawShowForPlayer ( playerid, texdraw3 ); return 1;}OnPlayerCommandText ( playerid, cmdtext [ ] ){ new idx; if ( strcmp ( cmdtext, \"/textdraw\", true ) == 0 ) { new i_str [ 4 ]; i_str = strtok ( cmdtext, idx ); if ( !strlen ( i_str ) ) return SendClientMessage ( playerid, 0xFFFFFF, \"Használat: /textdraw [ ON -OFF]\" ); else if ( strcmp ( i_str,\"on\", true ) == 0 ) { TextDrawShowForPlayer ( playerid, textdraw1 ); TextDrawShowForPlayer ( playerid, textdraw2 ); TextDrawShowForPlayer ( playerid, textdraw3 ); return 1; } else if ( strcmp ( i_str,\"off\",true ) == 0 ) { TextDrawHideForPlayer ( playerid, textdraw1 ); TextDrawHideForPlayer ( playerid, textdraw2 ); TextDrawHideForPlayer ( playerid, textdraw3 ); return 1; } return 1; } return 0;}strtok(const string[], &index){ new length = strlen(string); while ((index < length) && (string[index] <= \' \')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > \' \') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result;}
new i_str [ 24 ];
lambo96[]\" post=\"112155\" timestamp=\"1297272452\"]Na beraktam, nincs error viszont ha beírom h /textdraw nem ír semmit ha meg /textdraw on /textdraw off akkor Nem létezõ parancsHELP [/quote]Látszik, már nem vágom a sima parancsokat. Remélem van sscanf és zcmd. public OnPlayerConnect ( playerid ){ TextDrawShowForPlayer ( playerid, texdraw1 ); TextDrawShowForPlayer ( playerid, texdraw2 ); TextDrawShowForPlayer ( playerid, texdraw3 ); return 1;}CMD:textdraw ( playerid, params [ ] ){new i_str [ 24 ];if ( sscanf ( params, \"s[24]\", i_str ) ) return SendClientMessage ( playerid, 0xFFFFFF, \"Használat: /textdraw [ ON -OFF]\" );else if ( strcmp ( i_str,\"on\", true ) == 0 ){TextDrawShowForPlayer ( playerid, textdraw1 );TextDrawShowForPlayer ( playerid, textdraw2 );TextDrawShowForPlayer ( playerid, textdraw3 );return 1;}else if ( strcmp ( i_str,\"off\",true ) == 0 ){TextDrawHideForPlayer ( playerid, textdraw1 );TextDrawHideForPlayer ( playerid, textdraw2 );TextDrawHideForPlayer ( playerid, textdraw3 );return 1;}return 1;}
public OnPlayerConnect ( playerid ){ TextDrawShowForPlayer ( playerid, texdraw1 ); TextDrawShowForPlayer ( playerid, texdraw2 ); TextDrawShowForPlayer ( playerid, texdraw3 ); return 1;}CMD:textdraw ( playerid, params [ ] ){new i_str [ 24 ];if ( sscanf ( params, \"s[24]\", i_str ) ) return SendClientMessage ( playerid, 0xFFFFFF, \"Használat: /textdraw [ ON -OFF]\" );else if ( strcmp ( i_str,\"on\", true ) == 0 ){TextDrawShowForPlayer ( playerid, textdraw1 );TextDrawShowForPlayer ( playerid, textdraw2 );TextDrawShowForPlayer ( playerid, textdraw3 );return 1;}else if ( strcmp ( i_str,\"off\",true ) == 0 ){TextDrawHideForPlayer ( playerid, textdraw1 );TextDrawHideForPlayer ( playerid, textdraw2 );TextDrawHideForPlayer ( playerid, textdraw3 );return 1;}return 1;}