27.08.2011, 11:44
(
Последний раз редактировалось vent; 27.08.2011 в 20:40.
)
But it doesnt. Just crashes. If I commented that command, it compiles.
This is the original script.
Edit: Nvm, the command works but if i warn somebody, it always warns me.
pawn Код:
if (strcmp( cmd, "/warn", true ) == 0 ) {
if( IsPlayerConnected( playerid ) ) {
if( gPlayerLogged[ playerid ] == 0) {
return SendClientMessage( playerid, COLOR_GREY, " VIGA: Sa ei ole sisse logitud. ");
if( PlayerInfo[ playerid ][ pAdmin ] < 1 )
return SendClientMessage( playerid, COLOR_GREY, " VIGA: Ainult adminid vхivad seda kдsklust kasutada. ");
tmp = strtok(cmdtext, idx);
if( !strlen( tmp ) ) {
SendClientMessage( playerid, COLOR_GRAD2, " DEBUG: /hoiata <ID/NIMI> <Pхhjus> ");
return true ;
}
giveplayerid = ReturnUser( tmp );
if( IsPlayerConnected( giveplayerid ) ) {
if( giveplayerid != INVALID_PLAYER_ID ) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if( !strlen( result ) ) {
SendClientMessage( playerid, COLOR_GRAD2, " DEBUG: /hoiata <ID/NIMI> <Pхhjus>");
return true ;
}
PlayerInfo[ giveplayerid ][ pWarns ] ++ ;
if( PlayerInfo[ giveplayerid ][ pWarns ] >= 3) {
PlayerInfo[playerid][pLocked] = 2;
SendClientMessage( playerid, COLOR_LIGHTRED, " Sinu konto lukustati, kuna sul on tдpselt 3 vхi enam hoiatust. ");
Ban( giveplayerid );
return true ;
}
format( string, sizeof( string ), " Admin %s hoiatas sind. Pхhjus: %s. " , sendername , result );
SendClientMessage( giveplayerid, COLOR_LIGHTRED , string );
format( string, sizeof( string ), " Sa hoiatasid %s'i. Pхhjus: %s. " , giveplayer , result );
SendClientMessage( playerid ,COLOR_LIGHTRED , string );
return true ;
}
}
}
return true ;
}
Edit: Nvm, the command works but if i warn somebody, it always warns me.