SA-MP Forums Archive
Little help - 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: Little help (/showthread.php?tid=394694)



Little help - Trawltrawl - 23.11.2012

Hey just a simple question,
I'm making a command but i have a problem
pawn Код:
if (strcmp("/blow", cmdtext, true, 10) == 0)
    {
        if(GetPlayerSkin(playerid == 111) & (IsPlayerInRangeOfPoint(playerid, 3908.1470,-2664.6038,0.8423, 5))
        {
        CreateExplosion(0,0,0,0,0);
        }
        else
        {
        SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
        }
        return 1;
    }
How I can make this possible? That if the player skin is 111 and the player is in range of point 5, the explosion will appear?


Re: Little help - park4bmx - 23.11.2012

many errors in this code
pawn Код:
if (strcmp("/blow", cmdtext, true, 10) == 0)
    {
        if(GetPlayerSkin(playerid) == 111 && (IsPlayerInRangeOfPoint(playerid, 3908.1470,-2664.6038,0.8423, 5))
        {
                CreateExplosion(0,0,0,0,0);
        }else return SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
        return 1;
    }
Explained
GetPlayerSkin returns the players skinid, but it returns it outside the parameters!
To do a double check you use: &&.
the rest is all fine


Re: Little help - xMCx - 23.11.2012

pawn Код:
if (strcmp("/blow", cmdtext, true, 10) == 0)
    {
        if(GetPlayerSkin(playerid) == 111 && (IsPlayerInRangeOfPoint(playerid, 5.0,3908.1470,-2664.6038,0.8423))//5 should be the first
        {
                CreateExplosion(0,0,0,0,0);//0 wont create explosion
        }else return SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
        return 1;
    }



Re: Little help - Trawltrawl - 23.11.2012

Oh okay! Thanks for replying!
-
Just a quick thing
How to set sea waves?


Re: Little help - park4bmx - 23.11.2012

Quote:
Originally Posted by Trawltrawl
Посмотреть сообщение
Oh okay! Thanks for replying!
-
Just a quick thing
How to set sea waves?
not possible