#1

----------
Reply
#2

you shouldnt upload the pwn is it on the login system bit if so shows us the all code on the login dialog
Reply
#3

Do you have ArmyPermission PVar set to true when you trying to spawn as one of these?
Reply
#4

----------
Reply
#5

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.
Reply
#6

----------
Reply
#7

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'.
Reply
#8

----------
Reply
#9

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.
Reply
#10

----------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)