Jump to content

Recommended Posts

Posted (edited)

CMD:speed (playerid)

pAdminLevel=6

steru{activationspeed}=1

mesaje='Ai activat speed-boost'

steru{disablespeed}=0

mesaje='Ai dezactivat speed-boost'

return1;

Edited by Barosan de barosan.
Posted

CMD:speedup(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:X,Float:Y,Float:Z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
SetVehicleVelocity(GetPlayerVehicleID(playerid), X * 1.6, Y * 1.6, Z * 1.6);
}
}
return 1;
}
Posted

Sa incepem:

Primul pas (crearea variabilelor).


- primul pas consta in crearea variabilei de mai jos la inceputul gamemode-ului.

Source Code
  1. new SpeedBoost[MAX_PLAYERS];



Al doilea pas (crearea comenzii).


- adaugati aceasta comanda oriunde in gamemode dar neaparat sa fie sub variabila creata la pasul precedent.
 

Source Code
  1. CMD:speed(playerid, params[])
  2. {
  3. if(playerVariables[playerid][pAdminLevel] =< 6)
  4. {
  5. if(SpeedBoost[playerid])
  6. {
  7. SpeedBoost[playerid] = 0; // Dezactivat
  8. SCM(playerid, C_WHITE, "Ai dezactivat Speed Boost!");
  9. }
  10. else
  11. {
  12. SpeedBoost[playerid] = 1; // Activat
  13. SCM(playerid, C_WHITE, "Ai activat Speed Boost!");
  14. }
  15. }
  16. return 1;
  17. }
Show All

ATENTIE: Daca gamemodeul dvs. are variabilele diferite inlocuiti playerVariables[playerid][pAdminLevel] cu ce variabile folositi voi in gamemode, gen PlayerInfo[playerid][pAdmin], PlayerData[playerid][pAdmin] s.a.m.d.


Pasul al treilea.

- adaugati acest cod la public-ul OnPlayerKeyStateChange

Source Code
  1. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2. {
  3. if(newkeys & KEY_FIRE)
  4. {
  5. if(SpeedBoost[playerid] == 1)
  6. {
  7. new Float:vx, Float:vy, Float:vz;
  8. GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
  9. SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
  10. }
  11. }
  12. }
Show All

Sfarsit! Prin folosirea comenzii /speed puteti activa si dezactiva speed boost-ul. Odata activat il puteti utiliza apasand tasta ALT.
Daca v-am ajutat nu uitati de +1, mersi!

Posted

Sa incepem:

 

Primul pas (crearea variabilelor).

 

 

- primul pas consta in crearea variabilei de mai jos la inceputul gamemode-ului.

Source Code
  1. new SpeedBoost[MAX_PLAYERS];

 

Al doilea pas (crearea comenzii).

 

 

- adaugati aceasta comanda oriunde in gamemode dar neaparat sa fie sub variabila creata la pasul precedent.

 

Source Code
  1. CMD:speed(playerid, params[])
  2. {
  3. if(playerVariables[playerid][pAdminLevel] =< 6)
  4. {
  5. if(SpeedBoost[playerid])
  6. {
  7. SpeedBoost[playerid] = 0; // Dezactivat
  8. SCM(playerid, C_WHITE, "Ai dezactivat Speed Boost!");
  9. }
  10. else
  11. {
  12. SpeedBoost[playerid] = 1; // Activat
  13. SCM(playerid, C_WHITE, "Ai activat Speed Boost!");
  14. }
  15. }
  16. return 1;
  17. }
Show All

ATENTIE: Daca gamemodeul dvs. are variabilele diferite inlocuiti playerVariables[playerid][pAdminLevel] cu ce variabile folositi voi in gamemode, gen PlayerInfo[playerid][pAdmin], PlayerData[playerid][pAdmin] s.a.m.d.

 

 

Pasul al treilea.

 

- adaugati acest cod la public-ul OnPlayerKeyStateChange

Source Code
  1. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2. {
  3. if(newkeys & KEY_FIRE)
  4. {
  5. if(SpeedBoost[playerid] == 1)
  6. {
  7. new Float:vx, Float:vy, Float:vz;
  8. GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
  9. SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.8, vy *1.8, vz * 1.8);
  10. }
  11. }
  12. }
Show All

Sfarsit! Prin folosirea comenzii /speed puteti activa si dezactiva speed boost-ul. Odata activat il puteti utiliza apasand tasta ALT.

Daca v-am ajutat nu uitati de +1, mersi!

Imi place tutorialul, este facut de tine?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.

moduri samp