Variable Not Increasing
#1

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.
Код:
//------[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;
}
Second command to test your leader
Код:
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;
}
Where I kept my define

Код:
public OnPlayerConnect(playerid)
{
    FactionLeader[playerid] = 0;
Reply


Messages In This Thread
Variable Not Increasing - by Mike97300 - 13.06.2012, 21:18
Re: Variable Not Increasing - by Kindred - 13.06.2012, 21:25
Re: Variable Not Increasing - by Chris1337 - 13.06.2012, 21:25
Re: Variable Not Increasing - by Mike97300 - 13.06.2012, 21:34
Re: Variable Not Increasing - by PrawkC - 13.06.2012, 22:16

Forum Jump:


Users browsing this thread: 1 Guest(s)