SA-MP Forums Archive
Why it happen this? - 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)
+--- Thread: Why it happen this? (/showthread.php?tid=333427)



Why it happen this? - Face9000 - 11.04.2012

Hello,i've this problem:

http://www.freeimagehosting.net/newuploads/b7o34.jpg

It's happen only the first time i spawn,if i die and respawn,everything is normal.

What's wrong?

This is OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pVip] == 1) return SetPlayerArmour(playerid, 90);
   
    Create3DTextLabel("VIP Player", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    if(PlayerInfo[playerid][pVip] == 1) return Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);

    IsRobbing[playerid] =0;
    zoneupdates[playerid] = 1;
    player_zone[playerid] = -1;
    if(!zoneupdate) zoneupdate = SetTimer("update_zones",1000,4);
    SetPlayerToTeamColour(playerid);
    if(gTeam[playerid] == TEAM_COP)
    {
    new plwl = GetPlayerWantedLevel(playerid);
    plwl = GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid,plwl +0);
    GiveCopWeps(playerid);
    SendClientMessage(playerid, COLOR_BLUE, "You are a cop now.See /help for more info and /cmds.");
    SendClientMessage(playerid, COLOR_BLUE, "Your job is to arrest criminals.Do NOT kill other COPS or CIVILIANS,you are the LAW,respect it and give the good example.");
    }
    else if(gTeam[playerid] == TEAM_CIV)
    {
    SendClientMessage(playerid, COLOR_WHITE, "You are a civilian now.Your job is to rob players,stores and much more.Check /help for more info and /cmds.");
    SendClientMessage(playerid, COLOR_WHITE, "Please remember: This is NOT a deathmatch server,don't kill people randomly or you will be arrested or in extreme cases,killed.");
    }
    return 1;
}



Re: Why it happen this? - Faisal_khan - 11.04.2012

I also had this error try changing the virtual world.


Re: Why it happen this? - Face9000 - 11.04.2012

I've used SetPlayerInterior and it works,thanks anyway.


Re: Why it happen this? - ViniBorn - 11.04.2012

Replace

pawn Код:
//if one of these conditions are true, the rest of OnPlayerSpawn will not run ...
if(PlayerInfo[playerid][pVip] == 1) return SetPlayerArmour(playerid, 90);
   
    Create3DTextLabel("VIP Player", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    if(PlayerInfo[playerid][pVip] == 1) return Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);
pawn Код:
if(PlayerInfo[playerid][pVip] == 1) SetPlayerArmour(playerid, 90);
   
    Create3DTextLabel("VIP Player", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    if(PlayerInfo[playerid][pVip] == 1) Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);