17.10.2010, 13:30
If you want to make the code a bit more efficient and save some lines, you'd better change to zcmd and sscanf.
And for the :PlayerInfo[playerid][pLeader] part.
ZCMD + SScanf Example:
Didn't compile this.
And for the :PlayerInfo[playerid][pLeader] part.
pawn Код:
swtich(PlayerInfo[playerid][pLeader])
{
case 1: {} // Does shit if PlayerInfo[playerid][pLeader] == 1;
}
ZCMD + SScanf Example:
pawn Код:
command(invite, playerid, params[])
{
new iId;
if(sscanf(params, "i", iId)) return SendClientMessage(playerid, COLOR_GRAD2, "KASUTUS: /invite [mдngijaID/OsaNimest]");
if (PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
{
switch(PlayerInfo[playerid][pLeader])
{
case 1: // Could also add multiple cases like this: case 1,2,3: {}
{
PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "Police Force"; ChosenSkin[para1] = 71; SetPlayerSkin(para1, 71);
}
}
}
return 1;
}