Jump to content

[CERERE TUTORIAL]/buygun ZCMD


Domnu.MC

Recommended Posts

Salutare, ma poate ajuta si pe mine cineva cu un tutorial pentru comanda "/buygun" folosind ZCMD??Vreau macar un model cu o singura arma inclusa pe celelalte le pun eu, eu vreau doar asa in principiu ce trebuie facut deoarece vreau sa pun doar anumite arme. Va multumesc anticipat!!

Link to comment
Share on other sites

stock GetGunName(name) {
  	new id;
    switch(name) {
      case "Brass Knuckles": id = 1;
      case "Golf Club": id = 2;
      case "Nightstick": id = 3;
      case "Knife": id = 5;
      case "Baseball Bat": id = 6;
      case "Shovel": id = 7;
      case "AK47": id = 30;
    }
	return id;
}

CMD:buygun(playerid, params[]) {
	new gunname[32], ammo;
    if(sscanf(params, "s[32]d", gunname, ammo)) return SendClientMessage(playerid, -1, "/buygun <Gun Name> <Ammo>");
    GivePlayerWeapon(playerid, GetGunName(gunname), ammo);
    GivePlayerMoney(playerid, -500);
	return 1;
}

 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
On 30.12.2017 at 1:37 AM, BuNiCu-RP said:

stock GetGunName(name) {
  	new id;
    switch(name) {
      case "Brass Knuckles": id = 1;
      case "Golf Club": id = 2;
      case "Nightstick": id = 3;
      case "Knife": id = 5;
      case "Baseball Bat": id = 6;
      case "Shovel": id = 7;
      case "AK47": id = 30;
    }
	return id;
}

CMD:buygun(playerid, params[]) {
	new gunname[32], ammo;
    if(sscanf(params, "s[32]d", gunname, ammo)) return SendClientMessage(playerid, -1, "/buygun <Gun Name> <Ammo>");
    GivePlayerWeapon(playerid, GetGunName(gunname), ammo);
    GivePlayerMoney(playerid, -500);
	return 1;
}

 

Se poate si asa dar e mai bine pe dialog

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.gif

Link to comment
Share on other sites

CMD:buygun(playerid, params[])
	return ShowPlayerDialog(playerid, 73, DIALOG_STYLE_TABLIST_HEADERS, "Buy a gun", "Weapon\tPrice\n\
																			   {FFFFFF}Pistol\t{00FF00}500$\n\
																			   {FFFFFF}Silenced Pistol\t{00FF00}500$\n\
																			   {FFFFFF}Deagle\t{00FF00}1000$\n\
																			   {FFFFFF}Shotgun\t{00FF00}1500$", "Buy", "Close");
modifici cu ce arme vrei si dupa modifici in OnDialogResponse(mai simplu pentru playeri).

 

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.