09.07.2010, 12:52
Ik denk dat dit gaat werken (kunnen foutjes in zitten)
pawn Код:
//top
#define TEAM_NONE 0
#define TEAM_BALLAS 1
#define TEAM_GROVE 2
#define TEAM_SAPD 3
//top
new Team[MAX_PLAYERS];
//-----------
public OnPlayerConnect(playerid)
{
Team[playerid] = TEAM_NONE;
}
pawn Код:
if(!strcmp(cmd, "/setteam", true))
{
new tmp[256], tmp2[256], idx;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF0000AA, "Gebruik: /setteam [playerid] [team]");
tmp2 = strtok(cmdtext, idx);
if(!strlen(tmp2)) return SendClientMessage(playerid, 0xFF0000AA, "Gebruik: /setteam [playerid] [team]");
new giveplayerid = strval(tmp);
new team = strval(tmp2);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, 0xFF0000AA, "Die speler is niet online!");
new teamid;
if(!strcmp(team, "grove", true)) { teamid = TEAM_GROVE; }
if(!strcmp(team,"ballas",true)) { teamid = TEAM_BALLAS; }
if(!strcmp(team, "sapd", true)) { teamid = TEAM_SAPD; }
{
team[giveplayerid] = teamid;
SendClientMessage(playerid, 0xFF0000AA, "Team gezet!");
} else return SendClientMessage(playerid, 0xFF0000AA, "Dat team bestaat niet!");
return 1;
}