AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Errros in my code (https://forums.alliedmods.net/showthread.php?t=223764)

caked 08-16-2013 22:12

Errros in my code
 
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



^SmileY 08-16-2013 23:07

Re: Errros in my code
 
What errors?

iloadding 08-16-2013 23:54

Re: Errros in my code
 
Fallowing Errors:

PHP Code:

Colorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szNamePLUGINVERSIONAUTHOR ); 

Correct is:
PHP Code:

ChatColorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szName); 

Error:
PHP Code:

stock ColoridString[ ], any:... ) { 

Correct:
PHP Code:

stock ChatColoridString[ ], any:... ){ 

Error:
PHP Code:

Colorid""); 

Correct:
PHP Code:

ChatColorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szName); 

@EDIT:

There needs #include < colorchat >

Black Rose 08-17-2013 02:09

Re: Errros in my code
 
Quote:

Originally Posted by iloadding (Post 2015097)
Fallowing Errors:

PHP Code:

Colorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szNamePLUGINVERSIONAUTHOR ); 

Correct is:
PHP Code:

ChatColorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szName); 

Error:
PHP Code:

stock ColoridString[ ], any:... ) { 

Correct:
PHP Code:

stock ChatColoridString[ ], any:... ){ 

Error:
PHP Code:

Colorid""); 

Correct:
PHP Code:

ChatColorid"!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese."szName); 

@EDIT:

There needs #include < colorchat >

Since it's a stock inside his script named "Color" it doesn't need changing the name or adding of any external includes.

EDIT: I'm having no problem at all with the plugin.


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

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