23.02.2011, 17:07
hey, I'm working on an /invite command for faction leaders. I know how to invite them but I can't figure out how to set them to the faction I am inviting them from.
here is my code:
here is my code:
pawn Код:
COMMAND:invite(playerid, params[])
{
if(PlayerInfo[playerid][pFactionRank] == 5)
{
new otherplayerid;
if(sscanf(params, "u", otherplayerid)) // split input string and check level value 0 to 5
SendClientMessage(playerid, 0xFFFFFFFF, "/invite [playerid/name]");
else if(otherplayerid == INVALID_PLAYER_ID)
SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected");
else
{
new string[72];
format(string, sizeof(string), "Admin %s has invited you to factionID [%d]", GetPlayerNameEx(otherplayerid));
SendClientMessage(otherplayerid, 0xFFFFFFFF,string);
//What should I put here to set them in same faction as which I am inviting them from? PlayerInfo[playerid][pFaction] = PlayerInfo[otherplayerid][pFaction]; or what?
}
}
else
{
SendClientMessage(playerid, 0xAAAAAAAA, "you aren't admin");
}
return 1;
}