02.04.2011, 20:37
Hello!
trying to figure out how to "check" if the player is in a team or not. And if he is in a team you get a message that he is in a team already. how? i already have the text message in the code.
here is the code
trying to figure out how to "check" if the player is in a team or not. And if he is in a team you get a message that he is in a team already. how? i already have the text message in the code.
here is the code
pawn Код:
if(strcmp(cmd, "/setleader", true) == 0)
{
if(PlayerBase[playerid][pAdmin] == 1337)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SCM(playerid, COLOR_GREEN, "Use: /setleader [playerid] [Combat Team]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SCM(playerid, COLOR_GREEN, "Use: /setleader [playerid][ Combat Team]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendare, sizeof(sendare));
points = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(points == 0)
{
SetPlayerSkin(giveplayerid, 272);
PlayerBase[giveplayerid][pLedare] = 0;
PlayerBase[giveplayerid][pRang] = 0;
PlayerBase[playerid][pMedlem] = 0;
SetPlayerPos(giveplayerid, 414.6559,2531.7651,19.1601);
SetPlayerTeam(playerid, 4);
SetPlayerColor(playerid, COLOR_WHITE);
format(text, sizeof(text), "You Are No Longer A Team Command Chief Master!");
SCM(giveplayerid, COLOR_RED, text);
format(text, sizeof(text), "You Just Took %s's Command Chief Master Permissions", giveplayer);
SCM(playerid, COLOR_RED, text);
}
if(points == 1)
{
PlayerBase[giveplayerid][pLedare] = 1;
PlayerBase[giveplayerid][pRang] = 6;
PlayerBase[playerid][pMedlem] = 1;
SetPlayerColor(playerid, COLOR_BLUE);
SetPlayerTeam(playerid, 1);
UpdateRank(giveplayerid);
format(text, sizeof(text), "%s Just Made You To Command Chief Master Over Bluefoxes!", sendare);
SCM(giveplayerid, COLOR_GREEN, text);
format(text, sizeof(text), "You Just Made %s Command Chief Master Over Bluefoxes!", giveplayer);
SCM(playerid, COLOR_GREEN, text);
}
if(points == 2)
{
PlayerBase[giveplayerid][pLedare] = 2;
PlayerBase[giveplayerid][pRang] = 6;
PlayerBase[playerid][pMedlem] = 2;
SetPlayerColor(playerid, COLOR_YELLOW);
SetPlayerTeam(playerid, 2);
UpdateRank(giveplayerid);
format(text, sizeof(text), "%s Just Made You To Command Chief Master Over Thunderbirds!", sendare);
SCM(giveplayerid, COLOR_GREEN, text);
format(text, sizeof(text), "You Just Made %s To Command Chief Master Over Thunderbirds!", giveplayer);
SCM(playerid, COLOR_GREEN, text);
}
if(points == 3)
{
PlayerBase[giveplayerid][pLedare] = 3;
PlayerBase[giveplayerid][pRang] = 6;
PlayerBase[playerid][pMedlem] = 3;
SetPlayerColor(playerid, COLOR_GREY);
SetPlayerTeam(playerid, 3);
UpdateRank(giveplayerid);
format(text, sizeof(text), "%s Just Made You To Command Chief Master Over Airwolves!", sendare);
SCM(giveplayerid, COLOR_GREEN, text);
format(text, sizeof(text), "You Just Made %s To Command Chief Master Over Airwolves!", giveplayer);
SCM(playerid, COLOR_GREEN, text);
}
}
else(SCM(playerid, COLOR_RED, "That Player Is Already In A Team!"));
}
else(SCM(playerid, COLOR_RED, "You Are Not An Admin!"));
return 1;
}