SwatRights & ArmyRights + Vip Getting Annoying
#1

My Register

Код:
	            INI_WriteInt(PlayerAccount, "SwatRights", 0);
	            INI_WriteInt(PlayerAccount, "ArmyRights", 0);
	            INI_WriteInt(PlayerAccount, "Vip", 0);
LoadUser

Код:
if(!strcmp(name, "SwatRights")) SetPVarInt(playerid, "SWATRIGHTS", strval(value));
    if(!strcmp(name, "ArmyRights")) SetPVarInt(playerid, "ARMYRIGHTS", strval(value));
    if(!strcmp(name, "Vip")) SetPVarInt(playerid, "VIP", strval(value));
Save Player Account
Код:
INI_WriteInt(PlayerAccount, "SwatRights", GetPlayerSwatRights(playerid));
	INI_WriteInt(PlayerAccount, "ArmyRights", GetPlayerArmyRights(playerid));
	INI_WriteInt(PlayerAccount, "Vip", IsPlayerVip(playerid));
Request Class
Код:
public OnPlayerRequestSpawn(playerid)
{
	if(gTeam[playerid] == TEAM_ARMY && PlayerHasArmyRights(playerid, 0))
 	{
    	GameTextForPlayer(playerid,"~w~YOU CANNOT USE THIS CLASS~n~YOU HAVENT BEEN ACCEPTED INTO THE ARMY FORCE~n~ ~b~GO PLAY SOME MORE",5000,3);
		return 0;
	}
   	if(gTeam[playerid] == TEAM_SWAT && PlayerHasSwatRights(playerid, 0))
 	{
		GameTextForPlayer(playerid,"~w~YOU CANNOT USE THIS CLASS~n~YOU HAVENT BEEN ACCEPTED INTO THE SWAT FORCE~n~ ~b~GO PLAY SOME MORE",5000,3);
		return 0;
	}
	if(gTeam[playerid] == TEAM_Vip && PlayerHasVipRights(playerid, 0))
	{
	    GameTextForPlayer(playerid,"~w~YOU CANNOT USE THIS CLASS~n~YOU ARE NOT A V.I.P~b~ ASK AN ADMIN HOW TO BE ONE",5000,3);
		return 0;
 	}
	return 1;
}
Stocks
Код:
stock IsPlayerVip(playerid) return GetPVarInt(playerid, "VIP");
stock SetPlayerVip(playerid, vip) return SetPVarInt(playerid, "VIP", vip);
stock PlayerHasVipRights(playerid, rights) return SetPVarInt(playerid, "VIP", rights);

stock GetPlayerSwatRights(playerid) return GetPVarInt(playerid, "SWATRIGHTS");
stock SetPlayerSwatRights(playerid, swatrights) return SetPVarInt(playerid, "SWATRIGHTS", swatrights);
stock PlayerHasSwatRights(playerid, rights) return SetPVarInt(playerid, "SWATRIGHTS", rights);

stock GetPlayerArmyRights(playerid) return GetPVarInt(playerid, "ARMYRIGHTS");
stock SetPlayerArmyRights(playerid, armyrights) return SetPVarInt(playerid, "ARMYRIGHTS", armyrights);
stock PlayerHasArmyRights(playerid, rights) return SetPVarInt(playerid, "ARMYRIGHTS", rights);
Ok, here is the problem. When I set my ArmyRights, SwatRights and Vip to 1 and try spawn as them I still get the message that I would send to people who haven't got those rights and I cannot spawn.
Reply
#2

the code is correct but why does it fudge up?
Reply
#3

So to overcome this problem I would need to do?
Reply
#4

Alright chill buddy, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)