SA-MP Forums Archive
YSF 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: YSF help (/showthread.php?tid=248579)



YSF help - Rivera - 14.04.2011

I downloaded YSF and I want some little help. I made a /fly command:

pawn Код:
CMD:fly(playerid, params[]) {
    #pragma unused params
    if(IsPlayerAdmin(playerid)) {
        SetPlayerGravity(playerid, 0);
    }
    else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You have no acces to this command");
    return 1;
}
And I think this should work. Now, for the /stopfly, I want that the player who is flying will be slowly putted down so his HP will be not lost. Can you help me?!


Re: YSF help - Rivera - 14.04.2011

pawn Код:
CMD:stopfly(playerid, params[]) {
    #pragma unused params
    if(IsPlayerAdmin(playerid)) {
        if(SetPlayerGravity(playerid, 0)) {
            SetPlayerGravity(playerid, 0.5);
        }
        else return SendClientMessage(playerid, COLOR_TAN, "You must be flying to use this command");
    }
    else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You have no acces to this command");
    return 1;
}
Should this work? Never tried that... :P


Re: YSF help - Max_Coldheart - 14.04.2011

I think no. You should use if(aGetPlayerGravity... Instead Of if(SetPlayerGravity. (i think)


Re: YSF help - Rivera - 14.04.2011

ermm... lemme try


Re: YSF help - Rivera - 14.04.2011

Nope, GetPlayerGravity isn't defined or w/e


Re: YSF help - Rivera - 15.04.2011

BUMP

I need help


Re: YSF help - Jake__ - 15.04.2011

Код:
forward timer();

CMD:stopfly(playerid, params[]) 
{
    #pragma unused params
    SetTimer("timer",5000,false);  // Allow enough time for the player to fall very close to the ground
    if(!(IsPlayerAdmin(playerid)) 
    {    
         SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not an RCON admin.");
    }  
    return 1;
}
public timer();
{
    SendClientMessage(playerid, yourcolor, "You've stopped flying."); 
    SetPlayerHealth(playerid, 100);
   //  SetGravity(integer);
}
Does this work for you, good sir?
Please note: Edit the gravity to work with the timer, if possible.


Re: YSF help - Rivera - 15.04.2011

Well, I can't test it but I will try..