09.07.2010, 16:26
pawn Код:
if(!strcmp(cmd, "/setteam", true))
{
tmp = strtok(cmdtext, idx); //get the playerid as a string
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF0000AA, "Gebruik: /setteam [playerid] [team]");
new giveplayerid = strval(tmp); //transforming the string into a number
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xFF0000AA, "Die speler is niet online!");
tmp = strtok(cmdtext, idx); //getting the team
if(!strlen(tmp2)) return SendClientMessage(playerid, 0xFF0000AA, "Gebruik: /setteam [playerid] [team]");
new teamid;
if(!strcmp(tmp, "grove", true)) { teamid = TEAM_GROVE; }
else if(!strcmp(tmp,"ballas",true)) { teamid = TEAM_BALLAS; }
else if(!strcmp(tmp, "sapd", true)) { teamid = TEAM_SAPD; }
else
{
SendClientMessage(playerid, 0xFF0000AA, "Dat team bestaat niet!");
return 1;
}
team[giveplayerid] = teamid
SendClientMessage(playerid, 0xFF0000AA, "Team gezet!");
return 1;
}