SA-MP Forums Archive
--> Help With a CMD <-- - 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: --> Help With a CMD <-- (/showthread.php?tid=368817)



--> Help With a CMD <-- - xSkullx - 14.08.2012

Hi everybody, i have that ironman cmd, but it doesn't fly )
pawn Код:
on top:
new
    bool:flying[MAX_PLAYERS],
    Javelin[MAX_PLAYERS][2],
    Float:JavPos[MAX_PLAYERS][3];

on player command text:

  if(!strcmp(cmdtext, "/ironman", true))
    {
        if((flying[playerid] = !flying[playerid]))
        {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            SetPlayerHealth(playerid, 1000000000.0);
            SetTimerEx("IronMan", 100, 0, "d", playerid);
            SetTimerEx("DestroyMe", 500, 0, "d", CreateObject(2780, x, y, z - 3.0, 0.0, 0.0, 0.0));
            ShowPlayerDialog(playerid,91,DIALOG_STYLE_MSGBOX,"{6EF83C}Ironman", "{FF00EA}Ironman: {6EF83C}ON \n{FFFFFF}Scrie {6EF83C}/ironman {FFFFFF}ca sa-l dezactivezi.", "Ok", "" );
            }
            else
            SetPlayerHealth(playerid, 100.0);
        return 1;
    }



Re: --> Help With a CMD <-- - Shetch - 14.08.2012

Код:
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+10);
You won't fly, it will just put your player a couple meters higher.

You could also try creating a timer and checking if a key is pressed.
If a key is pressed add 1 to the z variable.


Re : --> Help With a CMD <-- - Eony - 14.08.2012

Check the flymode.pwn filterscript included by default in the SA-MP 0.3e server, might help you


Re: --> Help With a CMD <-- - xSkullx - 14.08.2012

What i have to do to make it to fly?


Re : Re: --> Help With a CMD <-- - Eony - 14.08.2012

Quote:
Originally Posted by xSkullx
Посмотреть сообщение
What i have to do to make it to fly?
Check this flymode.pwn. Just copy everything where it belongs in your FS / GM. Or even better, simply use that FS.


Re: --> Help With a CMD <-- - Shetch - 14.08.2012

Quote:
Originally Posted by xSkullx
Посмотреть сообщение
What i have to do to make it to fly?
Yea, the flymode.pwn should work pretty well.


Re: --> Help With a CMD <-- - xSkullx - 14.08.2012

Solved.
Thanks.