WTFCS Community | Gaming community @ since 2011
[TUTORIAL] Comanda [/speed] - Printable Version

+- WTFCS Community | Gaming community @ since 2011 (https://wtfcs.com/forum)
+-- Forum: WTFCS - GAMING (https://wtfcs.com/forum/forumdisplay.php?fid=1035)
+--- Forum: Lumea jocurilor (https://wtfcs.com/forum/forumdisplay.php?fid=3072)
+---- Forum: SA:MP (https://wtfcs.com/forum/forumdisplay.php?fid=3077)
+----- Forum: Ajutor scripting (https://wtfcs.com/forum/forumdisplay.php?fid=3594)
+------ Forum: Tutoriale (https://wtfcs.com/forum/forumdisplay.php?fid=3595)
+------ Thread: [TUTORIAL] Comanda [/speed] (/showthread.php?tid=68809)



[TUTORIAL] Comanda [/speed] - mihay111 - 04-10-2020

Tutorial facut de Capital

Pasul 1:

Cream:
Code:
new SpeedBoost[MAX_PLAYERS];


Pasul 2:

Cautam `public OnPlayerKeyStateChange` si adaugam: 


Code:
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
   {
       if(newkeys & KEY_FIRE)
       {
           if(SpeedBoost[playerid] == 1)
           {
               new Float:vx, Float:vy, Float:vz;
               GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
               SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
           }
       }
   }


Pasul 3:

Adaugam comanda, aceasta este:

Code:
CMD:speed(playerid, params[])
{
   if (PlayerInfo[playerid][pAdmin] >= 6)
   {
       if(SpeedBoost[playerid])
       {
           SpeedBoost[playerid] = 0; // Dezactivat
           SCM(playerid, COLOR_RED, "[Speed Boost]Ai dezactivat comanda Speed Boost!");
       }
       else
       {
           SpeedBoost[playerid] = 1; // Activat
           SCM(playerid, COLOR_GREEN, "[Speed Boost]Ai activat comanda Speed Boost!");
       }
   }
   return 1;
}