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



/up - KrYpToN98 - 05.04.2014

How can i nake a cmd like /up [height]
When u type for example /up 99 it takes u up to that height
And i want it as maximum height for 999999
[reps]


Re: /up - LocMax - 05.04.2014

pawn Код:
CMD:up(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, RED, "/up [height]");
    else
    {
        if(strval(params) > 999999) return SendClientMessage(playerid, -1, "Can't go higher than 999999.");
        new Float:oX, Float:oY, Float:oZ;
        GetPlayerPos(playerid, oX, oY, oZ);
        SetPlayerPos(playerid, oX, oY, oZ+strval(params));
    }
    return 1;
}



Re: /up - BroZeus - 05.04.2014

like this
pawn Код:
CMD:up(playerid,parmas[])
{
new hi;
if(sscanf(parmas,"i",hi))return SendClinetMessage(playerid,-1,"{ff0000}wrong usage do /up height");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,hi);
return 1;
}