AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help Fixing Errors (https://forums.alliedmods.net/showthread.php?t=105606)

jagged20101 10-06-2009 08:51

Help Fixing Errors
 
Error 1:

PHP Code:

434.sma(56) : error 017undefined symbol "iPlayers"
434.sma(56) : error 001expected token";"but found ")"
434.sma(56) : error 029invalid expressionassumed zero 

Section Of Code:

PHP Code:

public SGsLastRequest(id)
{
 new 
menu menu_create("\SGs Last Request:""menu_handler")
 
 
menu_additem(menu"\Knife fight""1"0);
 
menu_additem(menu"\Shot for shot""2"0);
 
menu_additem(menu"\Gun toss""3"0);
 
menu_additem(menu"\Spray Contest""4"0);
 
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
menu_display(idmenu0);
{
 new 
iPlayer[32], iT;
 
get_players(iPlayersiT"ae""TERRORIST");
 
 if (
iT == && cs_get_user_team(id) == CS_TEAM_T && is_user_alive(id))
 {
  
menu_handler(idmenuitem)
 }
 else
 {
  
client_print(idprint_chat"You cannot use that command.")
 }
}  



3Di 10-06-2009 08:57

Re: Help Fixing Errors
 
Change iPlayers to id.

3Di 10-06-2009 09:00

Re: Help Fixing Errors
 
1. Remove the '{' bracket above your get_players() function.

2. Remove new iPlayers[32].

3. Change iPlayers to id.

4. get_players(id, iT, "ae", "TERRORIST");

5. Remove the last bracket at the end of the code '}'

xPaw 10-06-2009 10:01

Re: Help Fixing Errors
 
Quote:

Originally Posted by 3Di (Post 953918)
3. Change iPlayers to id.
4. get_players(id, iT, "ae", "TERRORIST");

Thats wrong.

EDIT:
PHP Code:

public SGsLastRequestid ) {
    if( !
is_user_aliveid ) || cs_get_user_teamid ) != CS_TEAM_T )
        return 
PLUGIN_CONTINUE;
    
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiT"ae""TERRORIST" );
    
    if( 
iNum == ) {
        new 
menu menu_create"\SGs Last Request:""menu_handler" );
        
        
menu_additemmenu"Knife fight""1");
        
menu_additemmenu"Shot for shot""2");
        
menu_additemmenu"Gun toss""3");
        
menu_additemmenu"Spray Contest""4");
        
        
menu_displayidmenu);
    }
    
    return 
PLUGIN_CONTINUE;



jagged20101 10-06-2009 11:15

Re: Help Fixing Errors
 
bugsy gave me this code and it works 100% but thanks for trying to help :)

Quote:

~~~BUGSY~~~
new iPlayers[32] , iT;
get_players( iPlayers , iT , "ae" , "TERRORIST"
);

if (
iT == 1
)
{
menu_handler( iPlayers[0] , menu, item
);
}
else
{
client_print( iPlayers[0] , print_chat , "You cannot use that command."
);
}

I'm not getting this error:

PHP Code:

434.sma(97) : error 017undefined symbol "fm_set_rendering" 

heres the part of code:

PHP Code:

case 1:
 {
  if( 
is_user_alive(id) )
   
set_user_health(id100);
   
strip_user_weapons(id);
   
give_item(id"weapon_knife");
   
server_cmd("decalfrequency 15")
   
set_hudmessage(50255)
   
show_hudmessage(0,"[SGLR] Knife fight has been selected")  
   
fm_set_rendering(idkRenderFxGlowShell22500kRenderNormal16)
   
SubMenu1(id);
  } 


xPaw 10-06-2009 11:48

Re: Help Fixing Errors
 
fm_set_rendering -> set_user_rendering

izzle 10-06-2009 15:40

Re: Help Fixing Errors
 
Quote:


case
1:
{
if(
is_user_alive(id) )
set_user_health(id, 100);
strip_user_weapons(id);
give_item(id, "weapon_knife");
server_cmd("decalfrequency 15")
set_hudmessage(50, 255)
show_hudmessage(0,"[SGLR] Knife fight has been selected")
fm_set_rendering(id, kRenderFxGlowShell, 225, 0, 0, kRenderNormal, 16)
SubMenu1(id);
}

Steal my code more

jagged20101 10-07-2009 08:21

Re: Help Fixing Errors
 
lol thats not ur code, thats the code Vman gave me. so in that case u probably stole it from him or from some other poster on here and ur takin credit for it

izzle 10-07-2009 14:22

Re: Help Fixing Errors
 
Yeah its obviosly his
Quote:


case
1:
{
if(
is_user_alive(id) )
set_user_health(id, 100);
strip_user_weapons(id);
give_item(id, "weapon_knife");
server_cmd("decalfrequency 15")
set_hudmessage(50, 255)
show_hudmessage(0,"[ILR] Knife fight has been selected")
SubMenu1(id);
}

http://forums.alliedmods.net/showthread.php?t=104737

jagged20101 10-08-2009 08:37

Re: Help Fixing Errors
 
U probably took it from him, cause hes had his way before u even started. Cause i got it from him which means u must have also, so just stfu and keep stealin ppls code


All times are GMT -4. The time now is 22:38.

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