Jump to content

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


iStack

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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;
	}
	
Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...
  • 2 months later...
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

 

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

Join the conversation

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

Guest
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

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.