Reading only first 3 functions?
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerPlaySound(playerid, 1063, 0.0, 0.0, 0.0);
    if(God[playerid] == 1) SetPlayerHealth(playerid, 99999);
    if(PlayerInfo[playerid][pVip] == 1) SetPlayerArmour(playerid, 100.0);
    if(!PlayerInfo[playerid][Jail])
    {
        GameTextForPlayer(playerid, "~g~type ~w~/fr ~g~to change the mode",5000,1);
        if(fr[playerid] == 1)
        {
            SetPlayerVirtualWorld(playerid, 0);
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, -1680.1483,706.0532,30.6016);
            SetPlayerFacingAngle(playerid, 90.9011);
        }
        else if(indm[playerid] == 1)
        {
            SetPlayerTeam(playerid, NO_TEAM);
            SetPlayerPos(playerid, 1302.519897,-1.787510,1001.028259);
            SetPlayerInterior(playerid, 18);
            SetPlayerVirtualWorld(playerid, 2);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, 24, 999999);
        }
        else if(indm[playerid] == 2)
        {
            SetPlayerTeam(playerid, NO_TEAM);
            SetPlayerPos(playerid, 2215.454833,-1147.475585,1025.796875);
            SetPlayerInterior(playerid, 15);
            SetPlayerVirtualWorld(playerid, 1);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid, 34, 999999);
        }
    }
    else
    {
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, 198.1810, 174.9016, 1003.0234);
        SetPlayerFacingAngle(playerid, 0.6133);
        ResetPlayerWeapons(playerid);
        SetPlayerVirtualWorld(playerid, 50);
    }
    if(PlayerInfo[playerid][pMuted] == 1) MuteTimer[playerid] = SetTimerEx("OnPlayerUnmute", PlayerInfo[playerid][MuteTime], false, "d", playerid);
    IsJumping[playerid] = 0;
    TextDrawShowForPlayer(playerid, InfoTextdraw);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    SetPlayerWeatherEx(playerid, PlayerInfo[playerid][pWeather]);
    return 1;
}
You keep using 'return' in the middle of your statements. Return will break the code and prevent it from continuing. So if you meet any of the conditions in the 'if' statement, your code will end immediately after that.

https://sampwiki.blast.hk/wiki/Control_Structures#return
Thanks,+Rep
Reply


Messages In This Thread
Reading only first 3 functions? - by Mouiz - 06.07.2015, 07:39
Re: Reading only first 3 functions? - by Threshold - 06.07.2015, 07:54
Re: Reading only first 3 functions? - by Mouiz - 06.07.2015, 08:10

Forum Jump:


Users browsing this thread: 1 Guest(s)