Errors.
#7

PHP код:
CMD:removefromfaction(playeridparams[]) //Format to create a command
//Open bracket
    
new targetidtargetname[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(!IsPlayerAdmin(playerid) && pData[playerid][Rank] != 6) return SendClientMessage(playerid, -1"You are not a high enough admin or you aren't the leader!"); //Sends a message if they aren't the leader of the faction and if they aren't admin
    
GetPlayerName(targetidtargetnamesizeof(targetname)); //Stores the targetid's name in the targetname variable
    
GetPlayerName(playeridplayernamesizeof(playername)); //Stores the playerid's name in the playername variable
    
format(stringsizeof(string), "You removed %s from his (now) previous faction!"targetname);//Formats the message that will be sent to you (the player)
    
SendClientMessage(playerid, -1string);//Sends the message that is formatted above to the playerid in a random color
    
format(stringsizeof(string), "You were removed from your faction by %s!"playername);//Formats the message that will be sent to the targetid
    
SendClientMessage(targetid, -1string);//Sends the message that is formatted above to the targetid in a random color
    
pData[targetid][Faction] = 0//Sets their faction variable to 0 (civilian)
    
pData[targetid][Rank] = 0//Sets their rank variable to 0 (no rank)
    
return 1//Returns a value

PHP код:
 pData[playerid][Faction] = factionid;
        
pData[playerid][Rank] = 6
Try this.
Reply


Messages In This Thread
Errors. - by Benzke - 02.09.2012, 06:15
Re: Errors. - by TaLhA XIV - 02.09.2012, 06:16
Re: Errors. - by Benzke - 02.09.2012, 06:17
Re: Errors. - by TaLhA XIV - 02.09.2012, 06:20
Re: Errors. - by Benzke - 02.09.2012, 06:25
Re: Errors. - by Shockey HD - 02.09.2012, 06:26
Re: Errors. - by TaLhA XIV - 02.09.2012, 06:29
Re: Errors. - by Benzke - 02.09.2012, 06:31
Re: Errors. - by TaLhA XIV - 02.09.2012, 06:33
Re: Errors. - by Benzke - 02.09.2012, 06:34

Forum Jump:


Users browsing this thread: 3 Guest(s)