I need a /fall command
#1

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

Animation?
Reply
#3

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;
}

Reply
#4

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;
    }
Reply
#5

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

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;
Reply
#7

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>
Reply
#8

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)