05.04.2011, 16:42
My Register
LoadUser
Save Player Account
Request Class
Stocks
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.
Код:
INI_WriteInt(PlayerAccount, "SwatRights", 0); INI_WriteInt(PlayerAccount, "ArmyRights", 0); INI_WriteInt(PlayerAccount, "Vip", 0);
Код:
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));
Код:
INI_WriteInt(PlayerAccount, "SwatRights", GetPlayerSwatRights(playerid)); INI_WriteInt(PlayerAccount, "ArmyRights", GetPlayerArmyRights(playerid)); INI_WriteInt(PlayerAccount, "Vip", IsPlayerVip(playerid));
Код:
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; }
Код:
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);