Raised This Month: $ Target: $400
 0% 

Errros in my code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
caked
Member
Join Date: Dec 2012
Old 08-16-2013 , 22:12   Errros in my code
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <colorchat>
#include <fakemeta>
#include <cstrike>
#include <fun>
 
#define PLUGIN "DeathMatch: All Stars"
#define VERSION "1.0"
#define AUTHOR "Cheese"
 
new amx_gamename;
new 
g_pWelcomeMsg;
 
public 
plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_plugin"Game Namer""1.1""Cheese" ); 
amx_gamename register_cvar"amx_gamename""DeathMatch: All Stars" ); 
register_forwardFM_GetGameDescription"GameDesc" ); 
g_pWelcomeMsg register_cvar"amxx_welcome""1" );
RegisterHam(Ham_Spawn"player""DeathMatchClassMenu");
}
public 
DeathMatchClassMenu(id)
{
new 
menu menu_create("\yDeathMatch Class Menu :""DeathMatchClassMenu_handler");
menu_additem(menu"\wPistols \r(Glock, Usp, Deagle)""1"0);
menu_additem(menu"\wShotguns \r(Shotgun, Auto Shotgun""2"0);
menu_additem(menu"\wSMG \r(Mac 10, Mp5)""3"0);
menu_additem(menu"\wRifles \r(Ak47, Scout)""4"0);
menu_additem(menu"\wMachine Guns \r(M249)""5"0);
menu_setprop(menuMPROP_EXITMEXIT_ALL);
menu_display(idmenu0);
}
public 
DeathMatchClassMenu_handler(idmenuitem)
{
if( 
item == MENU_EXIT )
{
menu_destroy(menu);
return 
PLUGIN_HANDLED;
}
new 
data[6], iName[64];
new 
accesscallback;
menu_item_getinfo(menuitemaccessdata,5iName63callback);
new 
key str_to_num(data);
switch(
key)
{
case 
1:
{
give_item(id"weapon_glock18");
cs_set_user_bpammoidCSW_GLOCK18120 );
give_item(id"weapon_usp");
cs_set_user_bpammoidCSW_USP120 );
give_item(id"weapon_deagle");
cs_set_user_bpammoidCSW_DEAGLE120 );
}
case 
2:
{
give_item(id"weapon_m3");
cs_set_user_bpammoidCSW_M3120 );
give_item(id"weapon_xm1014");
cs_set_user_bpammoidCSW_XM1014120 );
}
case 
3
{
give_item(id"weapon_mac10");
cs_set_user_bpammoidCSW_MAC10120 );
give_item(id"weapon_mp5navy");
cs_set_user_bpammoidCSW_MP5NAVY120 );
}
case 
4:
{
give_item(id"weapon_ak47");
cs_set_user_bpammoidCSW_AK47120 );
give_item(id"weapon_scout");
cs_set_user_bpammoidCSW_SCOUT120 );
}
case 
5:
{
give_item(id"weapon_m249");
cs_set_user_bpammoidCSW_M249120 );
}
}
return 
PLUGIN_HANDLED;
}
public 
client_putinserverid ) {
 
set_task60.0"Advertise"id__"b" );
 
set_task5.0"Welcome"id );
}
public 
Welcomeid ) {
 new 
szName32 ]; get_user_nameidszNamecharsmaxszName ) );
 
Colorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szNamePLUGINVERSIONAUTHOR );
}
public 
Advertiseid ) {
 if( 
get_pcvar_numg_pWelcomeMsg ) ) {
  
Colorid"");
 }
}
stock ColoridString[ ], any:... ) {
 static 
szMsg192 ];
 
vformatszMsgcharsmaxszMsg ), String);
 
 
replace_allszMsgcharsmaxszMsg ), "!n""^1" );
 
replace_allszMsgcharsmaxszMsg ), "!t""^3" );
 
replace_allszMsgcharsmaxszMsg ), "!g""^4" );
 
 static 
msgSayText 0;
 if( !
msgSayText msgSayText get_user_msgid"SayText" );
 
 new 
Players32 ], iNum 1i;
 
 if( 
id Players] = id;    
 else 
get_playersPlayersiNum"ch" );
 
 for( --
iNumiNum >= 0iNum-- ) {
  
PlayersiNum ];
  
  
message_beginMSG_ONE_UNRELIABLEmsgSayText_);
  
write_byte);
  
write_stringszMsg );
  
message_end( );
 }
}
public 
GameDesc( ) { 
 
static 
gamename[32]; 
get_pcvar_stringamx_gamenamegamename31 ); 
forward_returnFMV_STRINGgamename ); 
return 
FMRES_SUPERCEDE

caked is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode