Raised This Month: $ Target: $400
 0% 

code errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 07-04-2004 , 00:06   code errors
Reply With Quote #1

This is my code
Code:
new slapdmg = (get_cvar_num("sv_slappower"))     new slapnum = (get_cvar_num("sv_numslaps"))     new plist[32],pnum     get_players(plist, pnum ,"a")     for(new i=0; i<pnum; i++)     user_slap(plist,slapdmg,slapnum)     return PLUGIN_HANDLED
I get this error on user_slap(plist,slapdmg,slapnum)

Code:
error 035: argument type mismatch <argument 1>
Any suggestions?
__________________
Nick is offline
Send a message via MSN to Nick
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 07-04-2004 , 06:06  
Reply With Quote #2

Code:
native user_slap(index,power,rnddir=1);

-> change
Code:
user_slap(plist,slapdmg,slapnum)
to
Code:
user_slap(plist[i],slapdmg,slapnum)

but i guess you don't want to pass the slapnum variable to the rnddir param, which should specify whether he should be slapped in a random direction or in a direction based on where he is looking..
__________________
hello, i am pm
PM is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 07-04-2004 , 17:08  
Reply With Quote #3

Thanks I'll try it, good help
__________________
Nick is offline
Send a message via MSN to Nick
Downtown1
Veteran Member
Join Date: Mar 2004
Old 07-04-2004 , 17:13  
Reply With Quote #4

Code:
new slapdmg = (get_cvar_num("sv_slappower"))     new slapnum = (get_cvar_num("sv_numslaps"))     new plist[32],pnum     get_players(plist, pnum ,"a")     for(new i=0; i<pnum; i++)     for(new j = 0; j < slapnum; j++)     user_slap(plist[i],slapdmg)     return PLUGIN_HANDLED

Try this instead. I'd recommend using a set_task for the slap too, since you probably don't want them to be slapped twice instantenously.
Downtown1 is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 07-04-2004 , 17:52  
Reply With Quote #5

yes I tryed set_task but that gave me tons of runtime errors so I'm tryng user_slap.
__________________
Nick is offline
Send a message via MSN to Nick
Downtown1
Veteran Member
Join Date: Mar 2004
Old 07-05-2004 , 14:03  
Reply With Quote #6

Well, set task only allows you to pass one parameter array .
Downtown1 is offline
Nick
Senior Member
Join Date: Apr 2004
Location: Canada, Alberta, Cal
Old 07-06-2004 , 18:59  
Reply With Quote #7

Ryan helped me out alot, using set_task was the right way to go.
__________________
Nick is offline
Send a message via MSN to Nick
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 14:41.


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