16.04.2018, 16:05
Hi.
1. How can I set /uninvite to be unique as leader's faction ID? (if leader is factionID 1, thentargetid factionID must be 1 too)
Ex
If player A is in faction ID 2, player B who is leader of faction ID 1 can uninvite him, I don't want to do this.
2)
Here, every player is shown on /factionon (its like its shown online players on the server)
1. How can I set /uninvite to be unique as leader's faction ID? (if leader is factionID 1, thentargetid factionID must be 1 too)
Ex
PHP код:
CMD:uninvite(playerid, params[])
{ //Open bracket
new targetid, targetname[24], playername[24], string[128]; //Create the variables
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /removefromfaction [playerid/partofname]"); //Sends message if they do not type something in for the targetid/name
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player isn't connected
if(pInfo[playerid][pRank] < 15) return SendClientMessage(playerid, -1, "You are not the leader of a faction!");
GetPlayerName(targetid, targetname, sizeof(targetname)); //Stores the targetid's name in the targetname variable
GetPlayerName(playerid, playername, sizeof(playername)); //Stores the playerid's name in the playername variable
format(string, sizeof(string), "Ai demis jucatorul %s din factiune!", targetname);//Formats the message that will be sent to you (the player)
SendClientMessage(playerid, -1, string);//Sends the message that is formatted above to the playerid in a random color
format(string, sizeof(string), "Ai fost demis de catre %s!", playername);//Formats the message that will be sent to the targetid
SendClientMessage(targetid, -1, string);//Sends the message that is formatted above to the targetid in a random color
pInfo[targetid][pFaction] = 0; //Sets their faction variable to 0 (civilian)
pInfo[targetid][pRank] = 0; //Sets their rank variable to 0 (no rank)
return 1; //Returns a value
} //Closed bracket
2)
PHP код:
CMD:factionon(playerid, params[])
{
new str[128], DUTY_STR[24], COLOR, counter = 0;
SendClientMessage(playerid, -1, " - Members Online- ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][pFaction] == pInfo[i][pFaction])
{
if(!pInfo[i][pPoliceDuty])
{
DUTY_STR = "Off Duty";
COLOR = COLOR_WHITE;
}
else
{
DUTY_STR = "ON DUTY";
COLOR = COLOR_RED;
}
format(str, sizeof(str),"%s: %s - %s", GetRankName(i), PlayerName(i), DUTY_STR);
SendClientMessage(playerid, COLOR, str);
counter++;
}
}
}
return 1;
}