04.07.2013, 15:47
pawn Код:
// /invite [id]
// id is in the variable userid.
// Check if the player has been invited already, so invites will not overwrite.
if(GetPVarInt(userid, "FactionID") != 0)
return 1;
// Set the variable FactionID to the user selected.
SetPVarInt(userid, "FactionID", factionid);
// /acceptinvite
// Check the variable "FactionID" with GetPVar().
// If it exists or it is not zero, then the player has been invited.
// If so, when the command is sent, set him into the FactionID variable.
if(GetPVarInt(playerid, "FactionID") == 0)
return 1;
// Set him into the faction.
var[playerid][faction] = GetPVarInt(playerid, "FactionID");
// Feel free to add a notification message.
SendClientMessage([...]);
// Always remember to delete temporary variables when you don't need them anymore.
DeletePVar(playerid, "FactionID");