31.08.2013, 15:46
So I made /invite command, but how do I let the player choose will he join it or not? /accept or /deny it?
pawn Код:
CMD:invite(playerid, params[])
{
if(PlayerInfo[playerid][pLeader] >= 1)
{
new otherplayerid;
if(sscanf(params, "u", otherplayerid))
SendClientMessage(playerid, COLOR_RED, "/invite [playerid/name]");
else if(otherplayerid == INVALID_PLAYER_ID)
SendClientMessage(playerid, COLOR_RED, "Player not connected");
else
{
new string[72];
format(string, sizeof(string), "<!>%s has invited you to join their team!", GetPlayerNameEx(otherplayerid));
SendClientMessage(otherplayerid, COLOR_WHITE,string);
PlayerInfo[otherplayerid][pTeam] = PlayerInfo[playerid][pTeam];
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a team leader!");
}
return 1;
}