SA-MP Forums Archive
SeifAdmin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SeifAdmin (/showthread.php?tid=137954)



SeifAdmin - cozza123456 - 30.03.2010

Why isnt this working?


Код:
public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)) return 1;
if(AccountInfo[playerid][AdminLevel] == 5)
{
GivePlayerWeapon(playerid, 24, 99999);
GivePlayerWeapon(playerid, 27, 99999);
GivePlayerWeapon(playerid, 29, 99999);
GivePlayerWeapon(playerid, 34, 99999);
GivePlayerWeapon(playerid, 37, 99999);
GivePlayerWeapon(playerid, 31, 99999);
GivePlayerWeapon(playerid, 9, 1);
GivePlayerWeapon(playerid, 41, 99999);
GivePlayerWeapon(playerid, 43, 99999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
if(AccountInfo[playerid][AdminLevel] == 4)
{
GivePlayerWeapon(playerid, 23, 99999);
GivePlayerWeapon(playerid, 25, 99999);
GivePlayerWeapon(playerid, 30, 99999);
GivePlayerWeapon(playerid, 28, 99999);
GivePlayerWeapon(playerid, 33, 99999);
GivePlayerWeapon(playerid, 41, 99999);
GivePlayerWeapon(playerid, 43, 99999);
SetPlayerHealth(playerid, 50);
SetPlayerArmour(playerid, 50);
return 1;
}
if(AccountInfo[playerid][AdminLevel] == 3)
{
GivePlayerWeapon(playerid, 22, 99999);
GivePlayerWeapon(playerid, 33, 99999);
GivePlayerWeapon(playerid, 43, 99999);
SetPlayerHealth(playerid, 20);
SetPlayerArmour(playerid, 20);
return 1;
}
if(AccountInfo[playerid][AdminLevel] <= 2)
{
GivePlayerWeapon(playerid, 22, 99999);
GivePlayerWeapon(playerid, 6, 1);
GivePlayerWeapon(playerid, 43, 99999);
GivePlayerWeapon(playerid, 46, 1);
SetPlayerHealth(playerid, 100);
return 1;
}
return 1;
}
You dont recieve health, armour or weapons.

These Lines are definitely correct:
Код:
if(AccountInfo[playerid][AdminLevel] <= 2)



Re: SeifAdmin - 02manchestera - 30.03.2010

Try a low level of ammo and for health and armor chane from 100 to 100.00 most probley not that but mite work.


Re: SeifAdmin - Carlton - 30.03.2010

https://sampwiki.blast.hk/wiki/IsPlayerNPC

You did
pawn Код:
if(!IsPlayerNPC(playerid)) return 1;
If you have a ! before a function that means if it returns 0, so think about it. If the player is not a NPC, return 1. So remove the !.


Re: SeifAdmin - cozza123456 - 30.03.2010

That makes no difference to my script... right?


Re: SeifAdmin - Carlton - 30.03.2010

Yes, a big difference because it will block the OnPlayerSpawn callback, for players.


Re: SeifAdmin - PotH3Ad - 30.03.2010

Try this:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 0;
    if(AccountInfo[playerid][AdminLevel] == 5)
    {
        GivePlayerWeapon(playerid, 24, 99999);
        GivePlayerWeapon(playerid, 27, 99999);
        GivePlayerWeapon(playerid, 29, 99999);
        GivePlayerWeapon(playerid, 34, 99999);
        GivePlayerWeapon(playerid, 37, 99999);
        GivePlayerWeapon(playerid, 31, 99999);
        GivePlayerWeapon(playerid, 9, 1);
        GivePlayerWeapon(playerid, 41, 99999);
        GivePlayerWeapon(playerid, 43, 99999);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        return 1;
    }
    if(AccountInfo[playerid][AdminLevel] == 4)
    {
        GivePlayerWeapon(playerid, 23, 99999);
        GivePlayerWeapon(playerid, 25, 99999);
        GivePlayerWeapon(playerid, 30, 99999);
        GivePlayerWeapon(playerid, 28, 99999);
        GivePlayerWeapon(playerid, 33, 99999);
        GivePlayerWeapon(playerid, 41, 99999);
        GivePlayerWeapon(playerid, 43, 99999);
        SetPlayerHealth(playerid, 50);
        SetPlayerArmour(playerid, 50);
        return 1;
    }
    if(AccountInfo[playerid][AdminLevel] == 3)
    {
        GivePlayerWeapon(playerid, 22, 99999);
        GivePlayerWeapon(playerid, 33, 99999);
        GivePlayerWeapon(playerid, 43, 99999);
        SetPlayerHealth(playerid, 20);
        SetPlayerArmour(playerid, 20);
        return 1;
    }
    if(AccountInfo[playerid][AdminLevel] <= 2)
    {
        GivePlayerWeapon(playerid, 22, 99999);
        GivePlayerWeapon(playerid, 6, 1);
        GivePlayerWeapon(playerid, 43, 99999);
        GivePlayerWeapon(playerid, 46, 1);
        SetPlayerHealth(playerid, 100);
        return 1;
    }
    return 1;
}