Modificare plugin - drshop

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
s0uNNNdx
Membru, skill +1
Membru, skill +1
Posts: 227
Joined: 28 Jul 2013, 22:30
Detinator Steam: Da
CS Status: Joc pe fun.free-play.ro
Detinator server CS: Fun.Free-Play.Ro
Location: Prahova
Has thanked: 32 times
Contact:

07 Dec 2013, 20:24

Salut !
Imi puteti modifica pluginul drshop astfel incat semiclip'ul sa se poata cumpara odata la 5 runde .
Daca nu se poate , sa scoateti semiclip-ul si sa puneti m3 cu 10000 $
| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>

new g_Menu;

public plugin_init() {
	register_plugin("DrShop", "0.1", "Ex3cuTioN");
	
	g_Menu = register_menuid("DeathRun Shop");
	register_menucmd(g_Menu, 1023, "drshop");
	
	register_clcmd("say /shop","cmdShop",-1,"<cumperi diverse lucruri>");
	register_clcmd("say /drshop","cmdShop",-1,"<cumperi diverse lucruri>");
}

public cmdShop(id) {	
	new menuBody[512];
	
	add(menuBody, 511, "\rMagazinul DR.LEGENDCS.COM\w^n^n");
	add(menuBody, 511, "\r1. \wHe \y(Pret:500$)\w^n");
	add(menuBody, 511, "\r2. \wFlash \y(Pret:500$)\w^n");
	add(menuBody, 511, "\r3. \wDeagle \y(Pret:5000$)\w^n");
	add(menuBody, 511, "\r4. \wSpeed \y(Pret:5000$)\w^n");
	add(menuBody, 511, "\r5. \wGravitatie \y(Pret:12000$)\w^n");
	add(menuBody, 511, "\r6. \wInvizibilitate \y(Pret:15000$)\w^n");
	add(menuBody, 511, "\r7. \wViata \y(Pret:8000$)\w^n");
	add(menuBody, 511, "\r8. \wNoClip \y(Pret:16000$)\w^n");
	add(menuBody, 511, "\r0. \wExit^n");
	
	new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9);
	show_menu(id, keys, menuBody, -1, "DeathRun Shop");
}

public drshop(id, key) {
	switch(key) 
	{
		case 0:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 500) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g500$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 500;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat o grenada !gHe! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_hegrenade");
		}
		case 1:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 500) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g500$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 500;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat o grenada !gFlashBang! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_flashbang");
		}
		case 2:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 5000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g5000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 5000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat un !gDeagle! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_deagle");
		}
		case 3:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 5000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g5000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 5000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gViteza! !yAi ramas cu !g%d$",banif);
			
			new Float:speed = get_user_maxspeed(id) + 125.0;
			set_user_maxspeed(id,speed);
		}
		case 4:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 12000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g12000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 12000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gGravitatie! !yAi ramas cu !g%d$",banif);
			set_user_gravity(id,0.4);
		}
		case 5:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 15000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g15000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 15000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gInvizibilitate! !yAi ramas cu !g%d$",banif);
			set_entity_visibility(id, 0);
		}
		case 6:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 8000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g8000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 8000;
			new viata =get_user_health(id);
			set_user_health(id,viata+150);
			chat_color(id,"!g[Deathrun] !yAi cumparat !g150Hp! !yAi ramas cu !g%d$",banif);
		}
		case 7:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 16000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g16000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 16000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gNoClip !ypentru !g30 secunde! !yAi ramas cu !g%d$",banif);
			set_user_noclip(id,1);
			set_task(30.0,"removeInvis",id);
		}
		default: return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public removeInvis(id) {
	set_user_noclip(id,0);
}

stock chat_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")

if (id) players[0] = id; else get_players(players, count, "ch")
{
  for (new i = 0; i < count; i++)
  {
   if (is_user_connected(players))
   {
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
    write_byte(players);
    write_string(msg);
    message_end();
   }
  }
}
}


Multumesc !
Rapidserver
SimplyClever
Membru, skill 0
Membru, skill 0
Posts: 88
Joined: 21 Jul 2013, 16:20
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 18 times
Been thanked: 1 time
Contact:

31 Dec 2013, 18:57

Poftim nu era asa greu de modificat ;))
Shop | Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>
#include <fun>
#include <engine>

new g_Menu;

public plugin_init() {
	register_plugin("DrShop", "0.1", "Ex3cuTioN");
	
	g_Menu = register_menuid("DeathRun Shop");
	register_menucmd(g_Menu, 1023, "drshop");
	
	register_clcmd("say /shop","cmdShop",-1,"<cumperi diverse lucruri>");
	register_clcmd("say /drshop","cmdShop",-1,"<cumperi diverse lucruri>");
}

public cmdShop(id) {	
	new menuBody[512];
	
	add(menuBody, 511, "\rShop\w^n^n");
	add(menuBody, 511, "\r1. \wHe \y(Pret:500$)\w^n");
	add(menuBody, 511, "\r2. \wFlash \y(Pret:500$)\w^n");
	add(menuBody, 511, "\r3. \wDeagle \y(Pret:5000$)\w^n");
	add(menuBody, 511, "\r4. \wSpeed \y(Pret:5000$)\w^n");
	add(menuBody, 511, "\r5. \wGravitatie \y(Pret:12000$)\w^n");
	add(menuBody, 511, "\r6. \wInvizibilitate \y(Pret:15000$)\w^n");
	add(menuBody, 511, "\r7. \wViata \y(Pret:8000$)\w^n");
	add(menuBody, 511, "\r8. \wm3 \y(Pret:10000$)\w^n");
	add(menuBody, 511, "\r0. \wExit^n");
	
	new keys = ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9);
	show_menu(id, keys, menuBody, -1, "DeathRun Shop");
}

public drshop(id, key) {
	switch(key) 
	{
		case 0:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 500) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g500$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 500;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat o grenada !gHe! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_hegrenade");
		}
		case 1:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 500) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g500$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 500;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat o grenada !gFlashBang! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_flashbang");
		}
		case 2:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 5000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g5000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 5000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat un !gDeagle! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_deagle");
		}
		case 3:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 5000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g5000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 5000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gViteza! !yAi ramas cu !g%d$",banif);
			
			new Float:speed = get_user_maxspeed(id) + 125.0;
			set_user_maxspeed(id,speed);
		}
		case 4:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 12000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g12000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 12000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gGravitatie! !yAi ramas cu !g%d$",banif);
			set_user_gravity(id,0.4);
		}
		case 5:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 15000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g15000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 15000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat !gInvizibilitate! !yAi ramas cu !g%d$",banif);
			set_entity_visibility(id, 0);
		}
		case 6:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 8000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g8000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 8000;
			new viata =get_user_health(id);
			set_user_health(id,viata+150);
			chat_color(id,"!g[Deathrun] !yAi cumparat !g150Hp! !yAi ramas cu !g%d$",banif);
		}
		case 7:
		{
			new bani,banif;
			bani = cs_get_user_money(id);
			if(bani < 10000) {
				chat_color(id,"!g[Deathrun] !yAi nevoie de !g5000$");
				return PLUGIN_HANDLED;
			}
			
			banif = bani - 10000;
			cs_set_user_money(id,banif);
			chat_color(id,"!g[Deathrun] !yAi cumparat un !gm3! !yAi ramas cu !g%d$",banif);
			give_item(id,"weapon_m3");

		}
		default: return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public removeInvis(id) {
	set_user_noclip(id,0);
}

stock chat_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)

replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")

if (id) players[0] = id; else get_players(players, count, "ch")
{
  for (new i = 0; i < count; i++)
  {
   if (is_user_connected(players))
   {
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players)
    write_byte(players);
    write_string(msg);
    message_end();
   }
  }
}
}[/code]
BHOP.FREAKZ.RO
Image
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 12:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 305 times
Been thanked: 320 times
Contact:

09 Jan 2014, 14:57

Mutat @Modificari pluginuri

PS :[/b] Postati in categoria potrivita - "Modificari necesare ale pluginurilor".

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests