Raised This Month: $ Target: $400
 0% 

Pls some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szblb
Junior Member
Join Date: Dec 2004
Old 12-28-2004 , 07:48   Pls some help
Reply With Quote #1

This Code:
Code:
pos_tav[0]=pos_tav[0]/1.5 pos_tav[1]=pos_tav[1]/1.5 pos_tav[2]=pos_tav[2]/1.5

I have some problems :
- tag mismatch
- tag mismatch
- tag mismatch

Pls help

THX
szblb is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 12-28-2004 , 09:18  
Reply With Quote #2

Make sure to declare it float.

Code:
new Float:pos_tav[3]
Johnny got his gun is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-28-2004 , 12:37  
Reply With Quote #3

Yes, since you divide by a float and get a float as the result, but your data type cannot hold a float, it returns a tag mismatch. You could declare the variables as floats, as JGHG said, or if you want the data to be integers you can use the floatround function. Additionally, maybe you should try this shortcut operator:

Code:
pos_tav[0] /= 1.5 pos_tav[1] /= 1.5 pos_tav[2] /= 1.5
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
szblb
Junior Member
Join Date: Dec 2004
Old 12-29-2004 , 05:48  
Reply With Quote #4

Code:
public cmd_com(id) {     new pos_from[3]     new pos_to[3]     new Float:pos_tav[3]     new pos_set[3]         //------------------------------------------     //------------------------------------------     get_user_origin(id,pos_from,0)     get_user_origin(id,pos_to,3)     //------------------------------------------     pos_tav[0]=pos_to[0]-pos_from[0]     pos_tav[1]=pos_to[1]-pos_from[1]     pos_tav[2]=pos_to[2]-pos_from[2]     //------------------------------------------     pos_tav[0] = pos_tav[0]/1.5     pos_tav[1] = pos_tav[0]/1.5     pos_tav[2] = pos_tav[0]/1.5     //------------------------------------------     pos_set[0]=pos_to[0]-pos_tav[0]     pos_set[1]=pos_to[1]-pos_tav[1]     pos_set[2]=pos_to[2]-pos_tav[2]     //------------------------------------------     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(11)     write_coord(pos_from[0]+random_num(-50,50))     write_coord(pos_from[1]+random_num(-50,50))     write_coord(pos_from[2]+random_num(-50,50))     message_end()     //------------------------------------------     set_user_origin(id,pos_set)     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(11)     write_coord(pos_set[0])     write_coord(pos_set[1])     write_coord(pos_set[2]+10)     message_end() }

"new Float:pos_tav[3]" ---> Too many tag mismatch

pos_tav[0] /= 1.5 Not good

szblb is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 12-29-2004 , 07:19  
Reply With Quote #5

Tag mismatch, does your plugin even compiles?
Because I sometimes get many tag mismatches, and it compiles and works.
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
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:26.


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