---------- -
K3nX - 09.04.2013
----------
Re: Help. -
Fredrick - 09.04.2013
you shouldnt upload the pwn is it on the login system bit if so shows us the all code on the login dialog
Re: Help. -
Riddick94 - 09.04.2013
Do you have ArmyPermission PVar set to true when you trying to spawn as one of these?
---------- -
K3nX - 09.04.2013
----------
Re: Help. -
Riddick94 - 09.04.2013
Look:
pawn Код:
if(gTeam[playerid] == Team_Army && GetPVarInt(playerid, "ArmyPermission") == 0)
Probably your PVarInt for ArmyPermission is equal to '0'. To spawn as member of army or swat team you have to have different value in ArmyPermission than '0'. For example:
pawn Код:
SetPVarInt(playerid, "ArmyPermission", 1);
Just make a test command with the thing that I gave you above and use that test command and then try to spawn as member of army.
---------- -
K3nX - 09.04.2013
----------
Re: Help. -
Riddick94 - 09.04.2013
You mean
pawn Код:
cmd(army, playerid, params[])
{
if(GetPVarInt(playerid, "AdminLevel") == 0) return 0;
new ID; new string[120];
if(sscanf(params, "u", ID))
return SendClientMessage(playerid, COLOR_ERROR, "Usage: /army (ID)");
if(!IsPlayerConnected(ID))
return SendClientMessage(playerid, COLOR_ERROR, "Usage: /army (ID)");
if(GetPVarInt(ID, "ArmyPermission") == 1337)
return SendClientMessage(playerid, COLOR_ERROR, "That player is already army.");
format(string, 120, "[ARMY STATUS] Server Admin %s has made %s a member of the Army!", PlayerInfo(playerid), PlayerInfo(ID));
SendClientMessageToAll(COLOR_PURPLE, string);
SendAdminMessage(string);
CNR_PrintString(string);
SendClientMessage(playerid, COLOR_PURPLE, "You are now able to play as Los Santos Army. Be sure to stick with /rules.");
SetPVarInt(ID, "ArmyPermission", 1337);
return 1;
}
This command? Wait.. what?
pawn Код:
if(gTeam[playerid] == Team_Cop || gTeam[playerid] == Team_Army || gTeam[playerid] == Team_SWAT )
{
return 0;
}
Remove it from code (above ^) and test. But remember about ArmyPermission to have different than '0'.
---------- -
K3nX - 09.04.2013
----------
Re: Help. -
Riddick94 - 09.04.2013
Put this in yours OnPlayerConnect callback:
pawn Код:
SetPVarInt(playerid, "ArmyPermission", 0);
SetPVarInt(playerid, "SWATPermission", 0);
And this is how OnPlayerRequestSpawn callback should look like:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == Team_Army && GetPVarInt(playerid, "ArmyPermission") == 0)
{
GameTextForPlayer(playerid, "~p~You cannot play as army.", 5000, 3);
return 0;
}
if(gTeam[playerid] == Team_SWAT && GetPVarInt(playerid, "SWATPermission") == 0)
{
GameTextForPlayer(playerid, "~b~You cannot play as SWAT.", 5000, 3);
return 0;
}
if(gTeam[playerid] == Team_Cop && GetPlayerScore(playerid) < 20)
{
GameTextForPlayer(playerid, "~b~You must have 20 score to play as cop.", 5000, 3);
return 0;
}
return 1;
}
Actually, this line here:
pawn Код:
if(gTeam[playerid] == Team_Army && GetPVarInt(playerid, "ArmyPermission") == 0)
And second one with SWATPermission check, should have 'OR' operator in if statement. Because it says:
if player team is Team_Army (which you set in "SetPlayerTeamFromClass" function) and player ArmyPermission is equal to 0 - he can't spawn. But what if player have permission to be an Army member and his team is equal to Team_Army - he can't spawn. So change it to:
pawn Код:
if(gTeam[playerid] == Team_Army || GetPVarInt(playerid, "ArmyPermission") == 0)
And do the same thing with underneath if's statements.
---------- -
K3nX - 09.04.2013
----------