Starting to hate this bug.
#1

Hello,today i've posted a topic about a problem on OnPlayerSpawn,i was thinking with SetPlayerInterior and VirtualWorld was fixed,but nothing.

The error is this:

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

As you can see,i dont see nothing,only if i die and respawn everything goes back to normal.

Another error: I give the cops and civilians (my team) their personal weps and when that error appear,the player doesnt get weapons.

Here is OnPlayerSpawn

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pVip] == 1) return SetPlayerArmour(playerid, 90);
    if(PlayerInfo[playerid][pVip] == 1) return Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);

    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);

    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)
    {
    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.");
    GiveCopWeps(playerid);
    }
    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.");
    GiveCivWeps(playerid);
    }
    return 1;
}
Reply
#2

A return statement ends the function IMMEDIATELY. Any code that appears after a return has been called will never be executed. Therefor - your code - if a player is Vip, will set that player's armor and then abort execution of that callback.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
A return statement ends the function IMMEDIATELY. Any code that appears after a return has been called will never be executed. Therefor - your code - if a player is Vip, will set that player's armor and then abort execution of that callback.
So what i've to do for fix?
Reply
#4

Remove the returns

pawn Код:
if(PlayerInfo[playerid][pVip] == 1) SetPlayerArmour(playerid, 90);
if(PlayerInfo[playerid][pVip] == 1) Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)