SA-MP Forums Archive
Problemo "switch" - 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: Problemo "switch" (/showthread.php?tid=406138)



Problemo "switch" - [rG]Cold - 09.01.2013

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?


Re: Problemo "switch" - DaRk_RaiN - 09.01.2013

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.


Re: Problemo "switch" - [rG]Cold - 09.01.2013

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.


Re: Problemo "switch" - [rG]Cold - 09.01.2013

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.


Re: Problemo "switch" - Konstantinos - 09.01.2013

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.


Re: Problemo "switch" - [rG]Cold - 09.01.2013

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

Fixed!