Raised This Month: $ Target: $400
 0% 

argument type mismatch & loose indentation problem :/


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Damocles
Member
Join Date: Jan 2005
Old 01-20-2005 , 10:54   argument type mismatch & loose indentation problem :/
Reply With Quote #1

Hey,

Can someone tell me why im getting type mismatch values for the send_msg function. This is how id do it in Java apart from specifying the type of the parameter. Im getting these errors:

Code:
/home/users/amxmodx/tmp/phpSiEYQW.sma(79) : warning 217: loose indentation
/home/users/amxmodx/tmp/phpSiEYQW.sma(103) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp/phpSiEYQW.sma(106) : warning 217: loose indentation
/home/users/amxmodx/tmp/phpSiEYQW.sma(108) : error 035: argument type mismatch (argument 2)
p.s. HOW THE HELL do i get rid of the loose indentation, ive gone to extremes with my indentation and its still moaning

Code:
public send_msg(id, rateType, rateValue) { // code here }

Code:
public client_putinserver(id) {         new rate[16]     new cl_updaterate[16]     // Get users rate value     get_user_info(id, "rate", rate, 15)     // Get users updaterate value     get_user_info(id, "cl_updaterate", cl_updaterate, 15)     // If rate < set rate, inform admins     if ((str_to_num(rate)) < MIN_RATE)     {         send_msg(id, "rate", rate)     }     // If cl_updaterate < set cl_updaterate, inform admins     if ((str_to_num(cl_updaterate))<MIN_CLUPDATERATE)     {           send_msg(id, "cl_updaterate", cl_updaterate)     }     return PLUGIN_HANDLED }

Thanks for any help
Damocles is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-20-2005 , 15:14  
Reply With Quote #2

Indent warnings mean nothign at all. If they really bother you add this to your script

Code:
#pragma tabsize 0

I not sure where you are going with the send_msg but perhaps you may try this.

Code:
new playername[51] get_user_name(id, playername, 50) client_print(0, print_chat, "User %s has a rate of %s", playername, rate)
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Damocles
Member
Join Date: Jan 2005
Old 01-20-2005 , 15:38  
Reply With Quote #3

the send message function is used to print out to all the admin currently connected that either the players rate or updaterate are below a set value. Thats why i put the code in the send_msg function because its essentially the same code but simply changes based on whether the rate or the updaterate values are 'dodgy'

Im trying to pass it a string of which value is suspect so that it can be used to print out to the admins which value needs changing...and thats the output i get
Damocles is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-20-2005 , 16:42  
Reply With Quote #4

From what i know there is no send_msg. But you could do something like this

Code:
for(new i = 0; i>0, i<32, ++i) { if(get_user_flags(i) & ADMIN_IMMUNITY) client_print(i, print_chat, " %s Rate is %s", playername, rate)    }

of course assigning a name to player name and rate to rate.
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Damocles
Member
Join Date: Jan 2005
Old 01-21-2005 , 04:27  
Reply With Quote #5

lol

I know there is no send_msg function in the amx libraries. I have written my own function....which i take it is perfectly valid in small as it is in any other language

Here is the code just so you can see what it does. Like i said before its just to remove the need to write the code over again

Code:
public send_msg(id, rateType, rateValue) {       new playerName[32]     new strMesg[128]     get_user_name(id,playerName,31)     format(strMesg,127,"[WARNING] - %s has a low %s value (%s)",playerName, rateType, rateValue)     // Inform any current admins of users low rate     new players[32], inum, playerid     // Get all the players     get_players(players,inum)                       // For each player, check if they are an admin in order to know who to send msg to     for(new i = 0; i < inum; ++i)     {         playerid = players[i]         if (!(get_user_flags(playerid)&ADMIN_CHAT))         {                           client_print(playerid,print_chat,strMesg)         }     }     }

Heopfully this will make it clearer for you to see what im trying to do bishop
Damocles is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-21-2005 , 07:56  
Reply With Quote #6

It should be rateType[]

Code:
public send_msg(id, rateType[], rateValue) {       new playerName[32]     new strMesg[128]     get_user_name(id,playerName,31)     format(strMesg,127,"[WARNING] - %s has a low %s value (%s)",playerName, rateType, rateValue)     // Inform any current admins of users low rate     new players[32], inum, playerid     // Get all the players     get_players(players,inum)                       // For each player, check if they are an admin in order to know who to send msg to     for(new i = 0; i < inum; ++i)     {         playerid = players[i]         if (!(get_user_flags(playerid)&ADMIN_CHAT))         {                           client_print(playerid,print_chat,strMesg)         }     }     }
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Damocles
Member
Join Date: Jan 2005
Old 01-21-2005 , 08:28  
Reply With Quote #7

ahhh Geesu your a GENIUS ty
Damocles is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-21-2005 , 09:18  
Reply With Quote #8

Ah well see, there is always good thing to show all your codes ;). If you still get indent warnings (which you probably will) and if really hate seeing them. I suggest the

#pragma tabsize 0

method.
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 01-21-2005 , 10:24  
Reply With Quote #9

Umm, I'd rather suggest correct intentdation ;)
__________________
hello, i am pm
PM is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 01-21-2005 , 10:33  
Reply With Quote #10

Quote:
Originally Posted by PM
Umm, I'd rather suggest correct intentdation ;)
O, so you'd rather be the wise guy. Always getting on peoples case. Just cause you think you better then them. With your fancy PM name.
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Reply



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 19:16.


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