problem with onplayerspawn `:\
#1

hello people, i post because since yesterday, i get problem with onplayerspawn :S. When I spawn, i'm supposed to get a pistol, one-handed, with 10 000 bullets. But when i spawn, i don't have any weapons, i think it could be a conflict with ladmin, because when i get weapons (ammunation, giveweapon) and i disconnect then reconnect, i still have the weapons i had before leaving :\ but if i remove all weapons, and come back, i don't get the pistol as it should. what the hell?

here's my onplayerspawn callback:
pawn Код:
public OnPlayerSpawn(playerid)

{
    new Random = random(5);
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
    SetPlayerDrunkLevel(playerid, 0);
    SetPlayerColor(playerid, PlayerColors[playerid]);
    SendClientMessage(playerid,0x42ACF5FF,"Own 'em All!");
    TogglePlayerControllable(playerid,1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 100);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 500);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 500);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 100);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 100);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 300);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 200);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 100);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 500);
    GivePlayerWeapon(playerid, 22, 10000); // Pistol with 10000 bullets
    GivePlayerMoney(playerid, 10000);
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,1);

    return 1;

}
and ladmin's one:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(ServerInfo[Locked] == 1 && PlayerInfo[playerid][AllowedIn] == false)
    {
        GameTextForPlayer(playerid,"~r~Server Locked~n~You must enter password before spawning~n~/password <password>",4000,3);
        SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
        return 1;
    }

    if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
    {
        #if USE_DIALOGS == true
        new lstring[256];
        format(lstring,256,"You Are Currently Not Logged In %s, You May Do So.",pName(playerid));
        ShowPlayerDialog(playerid,DIALOGID0+2,DIALOG_STYLE_INPUT,"Login Account",lstring,"Login","Quit");
        TogglePlayerControllable(playerid, 0);
        label[playerid] = Create3DTextLabel("LOGING-IN",green,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
        #endif
        return 1;
    }

    if(ServerInfo[MustRegister] == 1 && PlayerInfo[playerid][Registered] == 0)
    {

        new lstring[256];
        format(lstring,256,"%s, You Doesn't Own An Account Yet.\n\n Register To Create One.",pName(playerid));
        ShowPlayerDialog(playerid,DIALOGID0+1,DIALOG_STYLE_INPUT,"Register Account",lstring,"Register","Quit");
        TogglePlayerControllable(playerid, 0);
        label[playerid] = Create3DTextLabel("Registering",red,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
        return 1;
    }

    PlayerInfo[playerid][Spawned] = 1;

    if(PlayerInfo[playerid][Frozen] == 1) {
        TogglePlayerControllable(playerid,false); return SendClientMessage(playerid,red,"You Can't Move. You Are Still Frozen");
    }
   
    if(PlayerInfo[playerid][Jailed] == 1) {
        SetTimerEx("JailPlayer",3000,0,"d",playerid); return SendClientMessage(playerid,red,"You Can't Get Out. You Are Still In Jail");
    }
   
    if(ServerInfo[AdminOnlySkins] == 1) {
        if( (GetPlayerSkin(playerid) == ServerInfo[AdminSkin]) || (GetPlayerSkin(playerid) == ServerInfo[AdminSkin2]) ) {
            if(PlayerInfo[playerid][Level] >= 1)
                GameTextForPlayer(playerid,"~b~Welcome~n~~w~Admin",3000,1);
            else {
                GameTextForPlayer(playerid,"~r~This Skin Is For~n~Administrators~n~Only",4000,1);
                SetTimerEx("DelayKillPlayer", 2500,0,"d",playerid);
                return 1;
            }
        }
    }
   
    if((dUserINT(PlayerName2(playerid)).("UseSkin")) == 1)
        if((PlayerInfo[playerid][Level] >= 1) && (PlayerInfo[playerid][LoggedIn] == 1))
            SetPlayerSkin(playerid,(dUserINT(PlayerName2(playerid)).("FavSkin")) );

    if(ServerInfo[GiveWeap] == 1) {
        if(PlayerInfo[playerid][LoggedIn] == 1) {
            PlayerInfo[playerid][TimesSpawned]++;
            if(PlayerInfo[playerid][TimesSpawned] == 1)
            {
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap1"), dUserINT(PlayerName2(playerid)).("weap1ammo") );
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap2"), dUserINT(PlayerName2(playerid)).("weap2ammo") );
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap3"), dUserINT(PlayerName2(playerid)).("weap3ammo") );
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap4"), dUserINT(PlayerName2(playerid)).("weap4ammo") );
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap5"), dUserINT(PlayerName2(playerid)).("weap5ammo") );
                GivePlayerWeapon(playerid, dUserINT(PlayerName2(playerid)).("weap6"), dUserINT(PlayerName2(playerid)).("weap6ammo") );
            }
        }
    }
    return 1;
}
if the problem is here, how could i combine both scripts to make it work? :S i've tried stuff, but didnt work... thanks for help

EDIT: forgot to say, the sawn-offs, pistols, uzis, tec-9 are still two-handed.. :\
Reply
#2

i know using that...... look my onplayerspawn callback
Reply
#3

DELETE POST
Reply
#4

still same problem :\
Reply
#5

Do you get 10k money?
Reply
#6

@ ikey's if yes then you should put printf after every thing (except the skills then )
Reply
#7

can you tell me how please?thanks but why it was working and now it isn't?
Reply
#8

wait i just saw i don't even get the money, what is wrong?
Reply
#9

Do you get anything at all, and has OnPlayerSpawn been used before? Try to set it all together.
Reply
#10

yes, it was used before, i said the problem appeared a few days ago... what is wrong?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)