Raised This Month: $ Target: $400
 0% 

What is wrong with it?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TiToTal
Member
Join Date: Feb 2006
Old 03-13-2006 , 18:57   What is wrong with it?
Reply With Quote #1

I don't know... here is the code:
Code:
public something(id) {     new players[32], num     get_players(players,num,"ac")     for(new i = 0; i < num;i++)     {         new origin[3]         get_user_origin(id,origin)         if(get_distance(origin,casaum) <= 100.0 || get_distance(origin,casadois) <= 100.0 || get_distance(origin,casatres) <= 100.0 || get_distance(origin,casaquatro) <= 100.0 || get_distance(origin,casacinco) <= 110.0 || get_distance(origin,casaseis) <= 110.0 || get_distance(origin,casasete) <= 110.0 || get_distance(origin,casaoito) <= 110.0 || get_distance(origin,casanove) <= 110.0 || get_distance(origin,casadez) <= 110.0 ||         get_distance(origin,umcasa) <= 100.0 || get_distance(origin,doiscasa) <= 100.0 || get_distance(origin,trescasa) <= 100.0 || get_distance(origin,quatrocasa) <= 100.0 || get_distance(origin,cincocasa) <= 110.0 || get_distance(origin,seiscasa) <= 110.0 || get_distance(origin,setecasa) <= 110.0 || get_distance(origin,oitocasa) <= 110.0 || get_distance(origin,novecasa) <= 110.0 || get_distance(origin,dezcasa) <= 110.0)         {             //code         }         if(get_distance(origin,casaum) > 100.0 || get_distance(origin,casadois) > 100.0 || get_distance(origin,casatres) > 100.0 || get_distance(origin,casaquatro) > 100.0 || get_distance(origin,casacinco) > 110.0 || get_distance(origin,casaseis) > 110.0 || get_distance(origin,casasete) > 110.0 || get_distance(origin,casaoito) > 110.0 || get_distance(origin,casanove) > 110.0 || get_distance(origin,casadez) > 110.0 ||         get_distance(origin,umcasa) > 100.0 || get_distance(origin,doiscasa) > 100.0 || get_distance(origin,trescasa) > 100.0 || get_distance(origin,quatrocasa) > 100.0 || get_distance(origin,cincocasa) > 110.0 || get_distance(origin,seiscasa) > 110.0 || get_distance(origin,setecasa) > 110.0 || get_distance(origin,oitocasa) > 110.0 || get_distance(origin,novecasa) > 110.0 || get_distance(origin,dezcasa) > 110.0)         {             //code         }         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }


It compiles normally...

but here is the console error message:

L 03/13/2006 - 20:540: [AMXX] Native error in "get_user_origin" on line 7590 (file "test.sma").


It doesn't executes after "if" because it can't get the origin... I don't know why...


can someone say what is wrong with this?
TiToTal is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-13-2006 , 20:23  
Reply With Quote #2

it looks like what you meant to do was put "players[i]" instead of "id". that is only in the for loop, not for anything outside of it.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
TiToTal
Member
Join Date: Feb 2006
Old 03-13-2006 , 21:29  
Reply With Quote #3

Quote:
Originally Posted by Kraugh
it looks like what you meant to do was put "players[i]" instead of "id". that is only in the for loop, not for anything outside of it.
but when I use players[i] the script only works with the first players who joins the server... so, I thought I had to put ID instead of players[i]...

EDIT: actually I don't know if it works only for the first who joined... but I tested this plugin with my friend, and both times we tested, who got in first got the plugin working correctly... and the other didn't... (sorry my english... I think you can understand
TiToTal is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 03-14-2006 , 12:56  
Reply With Quote #4

It is because of the id. players[i] or i would be correct to use. Also you dont need the id in the header.
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
TiToTal
Member
Join Date: Feb 2006
Old 03-14-2006 , 13:59  
Reply With Quote #5

Quote:
Originally Posted by Charr
It is because of the id. players[i] or i would be correct to use. Also you dont need the id in the header.
But players[i] didn't work properly =/
TiToTal is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-14-2006 , 16:22  
Reply With Quote #6

try it again anyway and let us know how it goes.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
TiToTal
Member
Join Date: Feb 2006
Old 03-14-2006 , 21:44  
Reply With Quote #7

Quote:
Originally Posted by Kraugh
try it again anyway and let us know how it goes.
here is the problem... nothing happens.. =(
The code works perfectly with the first to join the server (I tested this plugin ONLY whit 2 people in the server)...

But nothing, nothing happens to the second one... I can't believe something is wrong... but definately there is something =(
TiToTal is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-14-2006 , 23:02  
Reply With Quote #8

show me the rest of the code.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
TiToTal
Member
Join Date: Feb 2006
Old 03-15-2006 , 11:07  
Reply With Quote #9

here is it..
some variables are in portuguese...

(It's a code I made for harbu pulgin)

Code:
public something() {     new players[32], num     get_players(players,num,"ac")     for(new i = 0; i < num;i++)     {         new origin[3]         get_user_origin(players[i],origin)         if(get_distance(origin,casaum) <= 100.0 || get_distance(origin,casadois) <= 100.0 || get_distance(origin,casatres) <= 100.0 || get_distance(origin,casaquatro) <= 100.0 || get_distance(origin,casacinco) <= 110.0 || get_distance(origin,casaseis) <= 110.0 || get_distance(origin,casasete) <= 110.0 || get_distance(origin,casaoito) <= 110.0 || get_distance(origin,casanove) <= 110.0 || get_distance(origin,casadez) <= 110.0 ||         get_distance(origin,umcasa) <= 100.0 || get_distance(origin,doiscasa) <= 100.0 || get_distance(origin,trescasa) <= 100.0 || get_distance(origin,quatrocasa) <= 100.0 || get_distance(origin,cincocasa) <= 110.0 || get_distance(origin,seiscasa) <= 110.0 || get_distance(origin,setecasa) <= 110.0 || get_distance(origin,oitocasa) <= 110.0 || get_distance(origin,novecasa) <= 110.0 || get_distance(origin,dezcasa) <= 110.0)         {             if(is_user_database(players[i]) == 1)             {                 new query[256], authid[32]                 get_user_authid(players[i],authid,31)                 format(query,255,"SELECT sono FROM money WHERE steamid='%s'",authid)                 result = dbi_query(dbc,query)                 if(dbi_nextrow(result) > 0)                 {                     new currentsono = dbi_field(result,1)                     dbi_free_result(result)                     if(currentsono > 0)                     {                         edit_value(players[i],"money","sono","-",10)                     }                 }                 dbi_free_result(result)             }             return PLUGIN_HANDLED         }         if(get_distance(origin,casaum) > 100.0 || get_distance(origin,casadois) > 100.0 || get_distance(origin,casatres) > 100.0 || get_distance(origin,casaquatro) > 100.0 || get_distance(origin,casacinco) > 110.0 || get_distance(origin,casaseis) > 110.0 || get_distance(origin,casasete) > 110.0 || get_distance(origin,casaoito) > 110.0 || get_distance(origin,casanove) > 110.0 || get_distance(origin,casadez) > 110.0 ||         get_distance(origin,umcasa) > 100.0 || get_distance(origin,doiscasa) > 100.0 || get_distance(origin,trescasa) > 100.0 || get_distance(origin,quatrocasa) > 100.0 || get_distance(origin,cincocasa) > 110.0 || get_distance(origin,seiscasa) > 110.0 || get_distance(origin,setecasa) > 110.0 || get_distance(origin,oitocasa) > 110.0 || get_distance(origin,novecasa) > 110.0 || get_distance(origin,dezcasa) > 110.0)         {             new ran = random_num(1,2)             if(ran == 1)             {                 if(is_user_database(players[i]) == 1)                 {                     edit_value(players[i],"money","sono","+",random_num(1,2))                     new query[256], authid[32]                     get_user_authid(players[i],authid,31)                     format(query,255,"SELECT sono FROM money WHERE steamid='%s'",authid)                     result = dbi_query(dbc,query)                     if(dbi_nextrow(result) > 0)                     {                         new currentsono = dbi_field(result,1)                         dbi_free_result(result)                         if(currentsono >= 100)                         {                             client_print(players[i],print_chat,"[Sono Mod] Voce desmaiou de sono!^n")                             edit_value(players[i],"money","sono","=",90)                             set_user_maxspeed(players[i],-1.0)                             set_task(2.0,"desmaiar",players[i])                             set_task(30.0,"acordar",players[i])                         }                     }                     dbi_free_result(result)                 }             }         }         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }
TiToTal is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 03-15-2006 , 15:48  
Reply With Quote #10

how is your something function called?
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
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 15:52.


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