SA-MP Forums Archive
I need a /fall 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: I need a /fall command (/showthread.php?tid=361371)



I need a /fall command - farCry.xD - 20.07.2012

Hey , have someone a /fall command who work's ?


Re : I need a /fall command - DeeCaay - 20.07.2012

Animation?


Re: I need a /fall command - Netinho_the_killer - 20.07.2012

I've created this one is very simple but I love it

Quote:

if (strcmp("/fall", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,-2504.2859, -701.3402, 403.2815);
SendClientMessage(playerid, 0xFFFF00AA, "Welcome to Fall enjoy it XD");
GivePlayerWeapon(playerid,46,1);
return 1;
}




Re: I need a /fall command - Jstylezzz - 20.07.2012

if you want the animation command...
here:

pawn Код:
if(strcmp(cmd, "/fall", true) == 0)
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return 1; }
        if (!strlen(cmdtext[6])) return SendClientMessage(playerid,COLOR_USAGE,"TIP: /fall [1-2]");//replace COLOR_USAGE with your own color
        switch (cmdtext[6])
        {
            case '1': LoopingAnim(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
            case '2': LoopingAnim(playerid, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
            default: SendClientMessage(playerid,COLOR_USAGE,"TIP: /fall [1-2]");
        }
        return 1;
    }



Respuesta: I need a /fall command - farCry.xD - 21.07.2012

I mean fall command , like up player with a height.. Or something


Re: I need a /fall command - Captain_Mani - 21.07.2012

Try this
Код:
if (strcmp("/fall", cmdtext, true, 10) == 0)
	{
		if (GetPlayerPos(playerid, x, y, z)){
		SetPlayerPos(playerid, x, y, 40);
		}
		return 1;
	}
First add this above public OnPlayerCommandText(playerid, cmdtext[])
Код:
new Float:x, Float:y, Float:z;



Respuesta: Re: I need a /fall command - farCry.xD - 21.07.2012

Quote:
Originally Posted by Captain_Mani
Посмотреть сообщение
Try this
Код:
if (strcmp("/fall", cmdtext, true, 10) == 0)
	{
		if (GetPlayerPos(playerid, x, y, z)){
		SetPlayerPos(playerid, x, y, 40);
		}
		return 1;
	}
First add this above public OnPlayerCommandText(playerid, cmdtext[])
Код:
new Float:x, Float:y, Float:z;
It work's but I want something like /fall <height>


Re: I need a /fall command - Captain_Mani - 21.07.2012

Sorry man, I haven't got an idea of how to make like that.
I think you will need to use strtok for that..


Re: I need a /fall command - Jstylezzz - 21.07.2012

Here you go:

ZCMD version, tested and works.
pawn Код:
CMD:fall(playerid,params[])
{
    new height;
    if(sscanf(params,"i",height)) return SendClientMessage(playerid,COLOR_RED,"Usage: /fall [height]");
    new Float:P,Float:O,Float:S;
    GetPlayerPos(playerid,P,O,S);
    SetPlayerPos(playerid,P,O,height);
    return 1;
}
and offc that other old sort, the strcmp command:
pawn Код:
if (strcmp(cmd, "/fall", true) == 0)
{
        new tmp[20],id;
        tmp = strtok(cmdtext, index);
        if (strlen(tmp)) return SendClientMessage(playerid,COLOR_RED,"Usage: /fall [height]");

        id = strval(tmp);
        new Float:P,Float:O,Float:S;
        GetPlayerPos(playerid,P,O,S);
        SetPlayerPos(playerid,P,O,id);


        return 1;
}
ZCMD command "installation", copy paste the first code inside the script, outside of any callback, i prefer at the bottom of the script, but OUTSIDE any callback.

i am sure you know how to put the other version in your script.

Tell me if they work


Respuesta: I need a /fall command - farCry.xD - 21.07.2012

Thx , man , it work's , you are awesomeee