Jump to content

Recommended Posts

Posted

Heey, as dorii si eu sa opresc comanda FLY pe buton, adica pe F, daca ma ajutati, voi fii entuziasmat <3 Comanda: fly

CMD:fly(playerid)
{
    StartFly(playerid);
    SetPlayerHealth(playerid, 1000);
    SendClientMessage(playerid, COLOR_RED, "[Admin]: Flymode a fost activat.");
    return 1;
    
}

Comanda stopfly:
CMD:stopfly(playerid)
{
    StopFly(playerid);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COLOR_RED, "[Admin] Flymode a fost dezactivat.");
    return 1;
    
}

Posted
2 minutes ago, FhenomenN said:

 

Am refacut comanda Fly, deoarece ma incurcasem, si nu mai stiam cum s-o o fak :D

CMD:stopfly(playerid)
{
    StopFly(playerid);
    SetPlayerHealth(playerid, 100);
    SendClientMessage(playerid, COLOR_RED, "[ADMIN]:Flymodeul a fost dezactivat.");
    return 1;
}

Posted

new flymode[MAX_PLAYERS];

la /fly pui flymode[playerid] = 1;

la /stopfly pui 0

te duci la OnPlayerKeyStateChange si cauti if (newkeys & KEY_SECONDARY_ATTACK)

 

pui

 

               if(flymode[playerid] == 1)
               {
                    flymode[playerid] = 0;
                    SendClientMessage(playerid, COLOR_DARKPINK, "Fly mode off.");
                    StopFly(playerid);
                    SetPlayerHealthEx(playerid, 100);
               }

  • 3 weeks later...
Posted

Salutare, daca doresti un videoclip uite-te aici : 

 

 

Pentru inceput faci o variabila cum ar fi:

UsedFly[MAX_PLAYERS];

 

Pentru a face comanda /fly iti trebuie include-ul care il gasesti pe internet. Daca stii sa modifici in el si sa scoti "InitFly(playerid)" ar fii bine deoarece eu nu l-am folosit in comanda de mai jos, mi se pare nefolositor.

Incepi si faci comanda.

CMD:fly(playerid, params[]) {
    if(UsedFly[playerid] == 0)
    {
        StartFly(playerid);
        SetPlayerHealth(playerid, 999999);
        SetPlayerArmour(playerid, 999999);
        SendClientMessage(playerid, COLOR_RED, "[ADMIN]: Flymode a fost activat.");
    }
    if(UsedFly[playerid] == 1)
    {
        StopFly(playerid);
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0);
        SendClientMessage(playerid, COLOR_RED, "[Admin] Flymode a fost dezactivat.");
    }
    return 1;
}

Mergi la OnPlayerKeyStateChange si incepi sa faci verificarea daca apasa pe tasta dorita.

Pentru a vedea tastele uite-te pe acest site : http://wiki.sa-mp.com/wiki/Keys

   if (newkeys & KEY_SECONDARY_ATTACK) {
        if(UsedFly[playerid] == 1) {
            StopFly(playerid);
            UsedFly[playerid] = 0;
            SetPlayerHealth(playerid, 100);
            return 1;
           }
   }

Pentru a nu se face buguri te duci la OnPlayerSpawn si faci verificarea daca are fly on, sa il dezactiveze : 
    if(UsedFly[playerid] == 1) {
        StopFly(playerid);
        UsedFly[playerid] = 0;
        SetPlayerHealth(playerid, 100);
    }

Aceasta merge si la OnPlayerDeath in loc de OnPlayerSpawn.

 

Sper ca ti-am fost de folos.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.