14.02.2013, 14:21
If I change this code:
To:
Ban cmd:
I get error undefined symbol "str". Str define is in ban cmd, how can I bypass this error?
Код:
forward BanPublic(playerid);
public BanPublic(playerid);
stock BanWithMessage(playerid, message[])
{
SendClientMessage(playerid, 0xFF4444FF, "Jūs uћblokuotas! Uћblokavo neteisingai? Pildyk unban anketą fr.tt.lt");
SetTimerEx("BanPublic", 1000, 0, "d", playerid);
}
Код:
forward BanPublic(playerid);
public BanPublic(playerid);
stock BanWithMessage(playerid, str[])
{
SendClientMessage(playerid, 0xFF4444FF, "Jūs uћblokuotas! Uћblokavo neteisingai? Pildyk unban anketą fr.tt.lt");
SetTimerEx("BanPublic", 1000, 0, "d", playerid);
}
Код:
CMD:ban( playerid, params[ ] )
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage( playerid, -1, "Tu ne administratorius!" );
new
id,
reason[ 64 ]
;
if(sscanf( params, "us[64]", id, reason ) ) return SendClientMessage( playerid, -1, "Naudojimas: /ban [Nickas] [Prieћastis]" );
if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Tokio ћaidėjo nėra." );
if(PlayerInfo[id][pPadmin] == 1) return SendClientMessage(playerid, -1, "Ką čia darai?");
new
str[ 128 ],
pName[ MAX_PLAYER_NAME ],
aName[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, aName, MAX_PLAYER_NAME );
GetPlayerName( id, pName, MAX_PLAYER_NAME );
format( str, sizeof( str ), "%s Uћblokavo ћaidėją %s. (Prieћastis: %s)", aName, pName, reason );
SendClientMessageToAll( -1, str );
BanWithMessage(id, str);
return 1;
}



it's really not hard.