Jump to content

[Tutorial Pawno] #1 Comanda /speed! (CMD)


Recommended Posts

Posted (edited)

Salut SA-MP.RO, bine v-am gasit la primul tutorial pawno. Astazi o sa va arat cum sa creati comanda (/speed).

Bun haideti sa incepem tutorialul.

Quote

Va multumesc mult ca ati apreciat acest tutorial, o sa mai vin cu alte [tutoriale pawno]. Va pup SA-MP.RO!!!

Edited by iStack
  • Like 1
Posted
On 9/29/2017 at 11:21 AM, iStack said:

new SpeedBoost[MAX_PLAYERS];

public OnPlayerKeyStateChange  ( Cautam in GameMode ).

  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);
            }
        }
    }

Adaugam comanda.

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;
}

Mersi chiar merge.Dar totusi era mai bine daca si explicai ceva mai mult nu doar sa dai comanda direct.

3 Stele din 5.

  • 2 weeks later...
Posted (edited)
On 9/29/2017 at 10:28 PM, Th3FuK3R Channel said:

Copiat de pe p****.ro

@Th3FuK3R Channel nu l-am copiat de pe (p****.ro). Ma uitam doar la tutoriale si am vazut (/speed), si am zis sa o fac si eu dar nu am copiato.

Edited by iStack
Posted

Comanda [/speed] ai putea sa o simplifici astfel:

 

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;
}

 

	CMD:speed(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_WHITE, "You are not an admin.");
	if(SpeedBoost[playerid] == 1) SpeedBoost[playerid] = 0, SCM(playerid, COLOR_WHITE, "Ai dezactivat speedboost");
	else SpeedBoost[playerid] = 1, SCM(playerid, COLOR_WHITE, "Ai activat speedboost.");
	return 1;
	}
	
  • 4 months later...
Posted

Daca ma intrebi pe mine, nu as folosii aceasta chestie, dar bun pentru incepatori !

+1

 

  • 2 weeks later...
  • 2 months later...
Posted

bun, hai sa incepem tutorialul 

link download:

 

sper ca v-a placut acest tutorial 

=))))))

  • Haha 2
Posted
La 22.10.2017 la 10:43, Dennis12. a spus:

Comanda [/speed] ai putea sa o simplifici astfel:

 

 


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;
}

 

 


	CMD:speed(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 6) return SCM(playerid, COLOR_WHITE, "You are not an admin.");
	if(SpeedBoost[playerid] == 1) SpeedBoost[playerid] = 0, SCM(playerid, COLOR_WHITE, "Ai dezactivat speedboost");
	else SpeedBoost[playerid] = 1, SCM(playerid, COLOR_WHITE, "Ai activat speedboost.");
	return 1;
	}
	

de asta ce zici? : https://pastebin.com/vk7ctUmZ

 

  • 2 weeks later...
  • 5 months later...
Posted

Ba ! voi astea cu comentari urate =]]]

La ‎25‎.‎06‎.‎2018 la 18:48, Meneaito a spus:

Asta numesti tu tutorial?

 

Zi mersi ca iti da mura in gura ca tu habar nu ai sa faci asa ceva =D, sau banuisc ca nu sti dar in proportie de 80% nu sti !

Boss eu iti recomand sa explici decat sa dai direct asa nu o sa invete nimeni nimic ! toti asteapta ca la botu calului !

Intai ti-as recomanda sa explici functiile ,fiecare ce face si cu ce ajuta pe mine asta sincer ma ajuta ca sa invat si eu daca tu imi dai deja facut asa nu o sa mai invat nimic.

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.