13.06.2012, 21:18
Well, I have a command setup to where the variable will increase but it doesn't here's the script, no errors, just doesn't work.
First command to increase it.
Second command to test your leader
Where I kept my define
First command to increase it.
Код:
//------[Makeleader]------- COMMAND:makeleader(playerid, params[]) { if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command "); new targetid; new giveplayerid; if(sscanf(params, "is[24]", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeleader [PlayerID/PartOfName]"); else if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,WHITE,"[ERROR] Player Is Not Connected"); else { SendClientMessage(targetid,COLOR_GREEN, "You have been made a faction leader!"); FactionLeader[targetid] += 1; } return 1; }
Код:
COMMAND:Invite(playerid, params[]) { if(FactionLeader[playerid] <= 1) return 0; new targetid; new giveplayerid; if(sscanf(params, "is[24]", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /invite [PlayerID/PartOfName]"); else if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,WHITE,"[ERROR] Player Is Not Connected"); else { SendClientMessage(targetid,COLOR_GREEN, "Your faction has been set to LSPD!"); LSPDMember[targetid] += 1; } return 1; }
Код:
public OnPlayerConnect(playerid) { FactionLeader[playerid] = 0;