SA-MP Forums Archive
/Oskin Command - 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: /Oskin Command (/showthread.php?tid=351434)



/Oskin Command - RyanPetersons - 16.06.2012

pawn Код:
CMD:oskin(playerid, params[])
{
if(PlayerOrg[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not in any organization, so stop using this command");
{
if (IsPlayerInRangeOfPoint(playerid, 3.0,2459.3740,-1690.8842,13.5464)) return SendClientMessage(playerid,COLOR_RED,"You are not at the GSF Headquater");
{
if (PlayerOrg[playerid] == 1)
{
SetPlayerColor(playerid, Green1);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 107);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,106);
GivePlayerWeapon(playerid, 5,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 28, 200);
}
if (IsPlayerInRangeOfPoint(playerid, 3.0,1905.9891,-1113.5447,26.6641)) return SendClientMessage(playerid,COLOR_RED,"You are not at the Ballas Headquater");
{
if (PlayerOrg[playerid] == 2)
{
SetPlayerColor(playerid, COLOR_PURPLE);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 102);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,103);
GivePlayerWeapon(playerid, 5,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 32, 200);
}
if (IsPlayerInRangeOfPoint(playerid, 3.0,1882.8102,-2016.0778,13.5469)) return SendClientMessage(playerid,COLOR_RED,"You are not at the Los Aztecas Headquater");
{
if (PlayerOrg[playerid] == 3)
{
SetPlayerColor(playerid, blue1);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 116);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 115);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 28, 200);
}
if (IsPlayerInRangeOfPoint(playerid, 3.0,1553.2577,-1675.4991,16.1953)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAPD Headquater");
{
if (PlayerOrg[playerid] == 4)
{
SetPlayerColor(playerid, COLOR_BLUE);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 280);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 281);
GivePlayerWeapon(playerid, 3,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 16, 50);
}
if (IsPlayerInRangeOfPoint(playerid, 3.0,213.4593,1869.0469,13.1406)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAAF Headquater");
{
if (PlayerOrg[playerid] == 5)
{
SetPlayerColor(playerid, Green2);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 287);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,286);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 24,200);
GivePlayerWeapon(playerid, 31, 200);
}
if (IsPlayerInRangeOfPoint(playerid, 3.0, -2650.2827,634.9139,14.4531)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAH Headquater");
{
if (PlayerOrg[playerid] == 6)
{
SetPlayerColor(playerid, red);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 274);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 275);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 17, 5);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return 1;
}
I made this command, there is no error in it, but when i log in, and when i set my self as the leader and when i do /oskin, then my skin doesn't changes, my color also doesn't changes, nothing changes, please tell me wats the problem with it.


Re: /Oskin Command - RyanPetersons - 16.06.2012

Now, the command works, but it have a bug, it doesn't works at the hqs, it works at any place.


Re: /Oskin Command - CrazyGab - 16.06.2012

You forgot to put "!" before the IsPlayerInRangeOfPoint.

P.S organise your code a little bit better next time

pawn Код:
CMD:oskin(playerid, params[])
{
if(PlayerOrg[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not in any organization, so stop using this command");
{
if (!IsPlayerInRangeOfPoint(playerid, 3.0,2459.3740,-1690.8842,13.5464)) return SendClientMessage(playerid,COLOR_RED,"You are not at the GSF Headquater");
{
if (PlayerOrg[playerid] == 1)
{
SetPlayerColor(playerid, Green1);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 107);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,106);
GivePlayerWeapon(playerid, 5,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 28, 200);
}
if (!IsPlayerInRangeOfPoint(playerid, 3.0,1905.9891,-1113.5447,26.6641)) return SendClientMessage(playerid,COLOR_RED,"You are not at the Ballas Headquater");
{
if (PlayerOrg[playerid] == 2)
{
SetPlayerColor(playerid, COLOR_PURPLE);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 102);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,103);
GivePlayerWeapon(playerid, 5,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 32, 200);
}
if (!IsPlayerInRangeOfPoint(playerid, 3.0,1882.8102,-2016.0778,13.5469)) return SendClientMessage(playerid,COLOR_RED,"You are not at the Los Aztecas Headquater");
{
if (PlayerOrg[playerid] == 3)
{
SetPlayerColor(playerid, blue1);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 116);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 115);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 28, 200);
}
if (!IsPlayerInRangeOfPoint(playerid, 3.0,1553.2577,-1675.4991,16.1953)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAPD Headquater");
{
if (PlayerOrg[playerid] == 4)
{
SetPlayerColor(playerid, COLOR_BLUE);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 280);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 281);
GivePlayerWeapon(playerid, 3,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 16, 50);
}
if (!IsPlayerInRangeOfPoint(playerid, 3.0,213.4593,1869.0469,13.1406)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAAF Headquater");
{
if (PlayerOrg[playerid] == 5)
{
SetPlayerColor(playerid, Green2);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 287);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid,286);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 24,200);
GivePlayerWeapon(playerid, 31, 200);
}
if (!IsPlayerInRangeOfPoint(playerid, 3.0, -2650.2827,634.9139,14.4531)) return SendClientMessage(playerid,COLOR_RED,"You are not at the SAH Headquater");
{
if (PlayerOrg[playerid] == 6)
{
SetPlayerColor(playerid, red);
if(IsLeader(playerid))
{
SetPlayerSkin(playerid, 274);
if(!IsLeader(playerid))
{
SetPlayerSkin(playerid, 275);
GivePlayerWeapon(playerid, 4,1);
GivePlayerWeapon(playerid, 22,200);
GivePlayerWeapon(playerid, 17, 5);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return 1;
}



Re: /Oskin Command - Dubya - 16.06.2012

Hold on. Give me a few minutes, I'll have this fixed for you.


Re: /Oskin Command - Dubya - 16.06.2012

Not Tested!
pawn Код:
CMD:oskin(playerid, params[])
{
    if(PlayerOrg[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not in any organization, so stop using this command");
    {
        if (IsPlayerInRangeOfPoint(playerid, 3.0,2459.3740,-1690.8842,13.5464))
        {
            if (PlayerOrg[playerid] == 1)
            {
                SetPlayerColor(playerid, Green1);
                if(IsLeader(playerid))
                {
                    SetPlayerSkin(playerid, 107);
                    if(!IsLeader(playerid))
                    {
                        SetPlayerSkin(playerid,106);
                        GivePlayerWeapon(playerid, 5,1);
                        GivePlayerWeapon(playerid, 22,200);
                        GivePlayerWeapon(playerid, 28, 200);
                    }
                }
            }
            else
            {
                SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
            }
        }
        else
        {
            SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
        }
        else if (IsPlayerInRangeOfPoint(playerid, 3.0,1905.9891,-1113.5447,26.6641))
        {
            if (PlayerOrg[playerid] == 2)
            {
                SetPlayerColor(playerid, COLOR_PURPLE);
                if(IsLeader(playerid))
                {
                    SetPlayerSkin(playerid, 102);
                    if(!IsLeader(playerid))
                    {
                        SetPlayerSkin(playerid,103);
                        GivePlayerWeapon(playerid, 5,1);
                        GivePlayerWeapon(playerid, 22,200);
                        GivePlayerWeapon(playerid, 32, 200);
                    }
                }
            }
            else
            {
                SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
            }
        }
        else
        {
            SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
        }
        else if (IsPlayerInRangeOfPoint(playerid, 3.0,1882.8102,-2016.0778,13.5469))
        {
            if (PlayerOrg[playerid] == 3)
            {
                SetPlayerColor(playerid, blue1);
                if(IsLeader(playerid))
                {
                    SetPlayerSkin(playerid, 116);
                    if(!IsLeader(playerid))
                    {
                        SetPlayerSkin(playerid, 115);
                        GivePlayerWeapon(playerid, 4,1);
                        GivePlayerWeapon(playerid, 22,200);
                        GivePlayerWeapon(playerid, 28, 200);
                    }
                }
            }
            else
            {
                SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
            }
        }
        else
        {
            SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
        }
                    else if (IsPlayerInRangeOfPoint(playerid, 3.0,1553.2577,-1675.4991,16.1953))
                    {
                        if (PlayerOrg[playerid] == 4)
                        {
                            SetPlayerColor(playerid, COLOR_BLUE);
                            if(IsLeader(playerid))
                            {
                                SetPlayerSkin(playerid, 280);
                                if(!IsLeader(playerid))
                                {
                                    SetPlayerSkin(playerid, 281);
                                    GivePlayerWeapon(playerid, 3,1);
                                    GivePlayerWeapon(playerid, 22,200);
                                    GivePlayerWeapon(playerid, 16, 50);
                                }
                            }
                        }
                        else
                        {
                            SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
                        }
                    }
                    else
                    {
                        SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
                    }
                    else if (IsPlayerInRangeOfPoint(playerid, 3.0,213.4593,1869.0469,13.1406))
                    {
                        if (PlayerOrg[playerid] == 5)
                        {
                            SetPlayerColor(playerid, Green2);
                            if(IsLeader(playerid))
                            {
                                SetPlayerSkin(playerid, 287);
                                if(!IsLeader(playerid))
                                {
                                    SetPlayerSkin(playerid,286);
                                    GivePlayerWeapon(playerid, 4,1);
                                    GivePlayerWeapon(playerid, 24,200);
                                    GivePlayerWeapon(playerid, 31, 200);
                                }
                            }
                        }
                        else
                        {
                            SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
                        }
                    }
                    else
                    {
                        SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
                    }
                    else if (IsPlayerInRangeOfPoint(playerid, 3.0, -2650.2827,634.9139,14.4531))
                    {
                        if (PlayerOrg[playerid] == 6)
                        {
                            SetPlayerColor(playerid, red);
                            if(IsLeader(playerid))
                            {
                                SetPlayerSkin(playerid, 274);
                                if(!IsLeader(playerid))
                                {
                                    SetPlayerSkin(playerid, 275);
                                    GivePlayerWeapon(playerid, 4,1);
                                    GivePlayerWeapon(playerid, 22,200);
                                    GivePlayerWeapon(playerid, 17, 5);
                                }
                            }
                        }
                        else
                        {
                            SendClentMessage(playerid,COLOR_WHITE,"You aren't a member of that orginization!");
                        }
                    }
                    else
                    {
                        SendClentMessage(playerid,COLOR_WHITE,"You aren't at the HQ!");
                    }
                }
            }
        }
    }
    return 1;
}



Re: /Oskin Command - CrazyGab - 16.06.2012

Well, test it, It should work the way I posted it!


Re: /Oskin Command - Dubya - 16.06.2012

Quote:
Originally Posted by CrazyGab
Посмотреть сообщение
Well, test it, It should work the way I posted it!
It should work the way he posted it.


Re: /Oskin Command - CrazyGab - 16.06.2012

Uh yeah, I didn't realise you were another person, Kinda tired


Re: /Oskin Command - Dubya - 16.06.2012

^ LOL!