YSF help
#1

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?!
Reply
#2

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

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

ermm... lemme try
Reply
#5

Nope, GetPlayerGravity isn't defined or w/e
Reply
#6

BUMP

I need help
Reply
#7

Код:
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.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)