Problemo "switch"
#1

pawn Код:
switch(gTeam[playerid])
    {
        case TEAM_MAFIA:
        {
            SetPlayerPos(playerid,2297.2202,2427.5864,10.8203);
            SetPlayerFacingAngle(playerid,135.7317);
            SetCameraBehindPlayer(playerid);
            switch(GetPlayerSkin(playerid))
            {
                case 280:
                {
                    SendClientMessage(playerid,COLOR_GREEN,"Hey");
                }
                case 281:
                {
                    SendClientMessage(playerid,COLOR_GREEN,"Hey Yo");
                }
                case 282:
                {
                    SendClientMessage(playerid,COLOR_GREEN,"Hey Yo All");
                }
            }
        }
    }
Ok so when i pick one of those SKIN IDs i spawn at the random place in LV where you spawn when have like an empty script.
And none of those messages show.
What the problem might be?
Reply
#2

Don't use cases
pawn Код:
if(GetPlayerSkin(playerid) == 280)
                {
                    SendClientMessage(playerid,COLOR_GREEN,"Hey");
                }
else if(GetPlayerSkin(playerid) == 281)
                {
                     SendClientMessage(playerid,COLOR_GREEN,"Hey Yo");
                }
else if(GetPlayerSkin(playerid) == 282)
                {
                   SendClientMessage(playerid,COLOR_GREEN,"Hey Yo All");
                }
For the spawn places you can add random spawn, if you want each skin to spawn on one place use AddPlayerClass.
Reply
#3

I want the skins to spawn in the same place but have different weapons!
And i actually tried what you suggested above but it didnt work either.
Reply
#4

Well yes i am pretty sure.
Actually i tried the old fashion way
pawn Код:
/*if(gTeam[playerid] == TEAM_COPS && GetPlayerSkin(playerid) == 280)
    {
        SetPlayerPos(playerid,2297.2202,2427.5864,10.8203);
        SetPlayerFacingAngle(playerid,135.7317);
        SetCameraBehindPlayer(playerid);
    }
    else if(gTeam[playerid] == TEAM_COPS && GetPlayerSkin(playerid) == 281)
    {
        SetPlayerPos(playerid,2297.2202,2427.5864,10.8203);
        SetPlayerFacingAngle(playerid,135.7317);
        SetCameraBehindPlayer(playerid);
    }
    else if(gTeam[playerid] == TEAM_COPS && GetPlayerSkin(playerid) == 282)
    {
        SetPlayerPos(playerid,2297.2202,2427.5864,10.8203);
        SetPlayerFacingAngle(playerid,135.7317);
        SetCameraBehindPlayer(playerid);
    }
and it worked just perfect.
Reply
#5

On your first code it's team "TEAM_MAFIA" and skins 280, 281, 282. On what you posted (your last post), it's team "TEAM_COPS" and skins 280, 281, 282. So, your team is wrong.
Reply
#6

Well ****** was right about that,i've set the wrong SKIN IDs for that team!

Fixed!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)