Raised This Month: $ Target: $400
 0% 

Problems compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-12-2006 , 17:58   Problems compiling
Reply With Quote #1

Code:
public makecar(id) {    new item[32], orig1[6], orig2[6], orig3[6], angles1[6], Float:origin[3], steamid    read_argv(1, item, 31)    read_argv(2, orig1, 5)    read_argv(3, orig2, 5)    read_argv(4, orig3, 5)    read_argv(5, angles1, 5)    read_argv(6, steamid, 32)    origin[0] = float(str_to_num(orig1))    origin[1] = float(str_to_num(orig2))    origin[2] = float(str_to_num(orig3))    new Float:angles2 = float(str_to_num(angles1))    steamid = get_user_authid(id,authid,32)    new car = create_entity("info_target")    if(!car) {       client_print(id,print_chat,"CAR WAS not created. Error.^n")       return PLUGIN_HANDLED    }

That part makes these 2 errors

Code:
Error: Argument type mismatch (argument 2) on line 61
Error: Undefined symbol "authid" on line 68
and this

Code:
public setcar(entid,id) {    if(allow[id] != 0) return PLUGIN_HANDLED    if(incar[id] != 0) return PLUGIN_HANDLED    if(equal(steamid,authid) && incar[id] == 0) {}    else return PLUGIN_HANDLED

make this error

Code:
Error: Undefined symbol "steamid" on line 228
wonsae is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 03-12-2006 , 18:37  
Reply With Quote #2

Top one:

steamid isn't an arg - in that case it should be steamid[33] (because your highest number in that sense is 32).

authid is never defined - it should also be an arg - authid[33] (because you use get_user_authid(id, authid, 32).

Also, for the third one, you defined what steamid was in one function, but it's separate from the other function, so the other function doesn't know what steamid is - you either have to redefine it, or globally define it.
Jordan is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-13-2006 , 14:31  
Reply With Quote #3

Code:
public makecar(id) {    new item[32], orig1[6], orig2[6], orig3[6], angles1[6], Float:origin[3], steamid[33]    read_argv(1, item, 31)    read_argv(2, orig1, 5)    read_argv(3, orig2, 5)    read_argv(4, orig3, 5)    read_argv(5, angles1, 5)    read_argv(6, steamid[33], 32)    origin[0] = float(str_to_num(orig1))    origin[1] = float(str_to_num(orig2))    origin[2] = float(str_to_num(orig3))    new Float:angles2 = float(str_to_num(angles1))    steamid[33] = get_user_authid(id,steamid[33],32)

Now I get these errors
Code:
Error: Array index out of bounds (variable "steamid") on line 61
Error: Array index out of bounds (variable "steamid") on line 68
wonsae is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-13-2006 , 15:07  
Reply With Quote #4

Don't add [33] after steamid in
Code:
read_argv(6, steamid[33], 32)
and
Code:
steamid[33] = get_user_authid(id,steamid[33],32)
I think that will solve your problem
+ Defining a steamid with itself looks a bit wierd
Werewolf is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-13-2006 , 15:31  
Reply With Quote #5

Code:
   steamid[33] = get_user_authid(id,authid[33],32)
meh i still get these errors
btw i changed it to authid[33] because of your comment ><

Code:
Error: Array index out of bounds (variable "steamid") on line 67
Warning: Expression has no effect on line 67
Error: Expected token: ";", but found "]" on line 67
Error: Invalid expression, assumed zero on line 67
Error: Too many error messages on one line on line 67
wonsae is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 03-13-2006 , 15:42  
Reply With Quote #6

Quote:
Originally Posted by wonsae
Code:
   steamid[33] = get_user_authid(id,authid[33],32)
meh i still get these errors
btw i changed it to authid[33] because of your comment ><

Code:
Error: Array index out of bounds (variable "steamid") on line 67
Warning: Expression has no effect on line 67
Error: Expected token: ";", but found "]" on line 67
Error: Invalid expression, assumed zero on line 67
Error: Too many error messages on one line on line 67
dont include the [33] or else the complier is going to access element 33 of the array where it is supposed to terminate giving you the out of bounds error

Code:
   steamid = get_user_authid(id,authid,32)
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 03-13-2006 , 16:18  
Reply With Quote #7

Quote:
Originally Posted by Zenith77
dont include the [33]
That's exactly what I said
Quote:
Originally Posted by Werewolf
Don't add [33]
Hihi
__________________
~~~~~Hawk~~~~~
Werewolf is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 03-13-2006 , 16:31  
Reply With Quote #8

Sorry I sometimes just scan over posts when I'm in a hurry
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-13-2006 , 17:04  
Reply With Quote #9

so it would be this?
Code:
public makecar(id) {    new item[32], orig1[6], orig2[6], orig3[6], angles1[6], Float:origin[3], steamid[33]    read_argv(1, item, 31)    read_argv(2, orig1, 5)    read_argv(3, orig2, 5)    read_argv(4, orig3, 5)    read_argv(5, angles1, 5)    read_argv(6, steamid, 32)    origin[0] = float(str_to_num(orig1))    origin[1] = float(str_to_num(orig2))    origin[2] = float(str_to_num(orig3))    new Float:angles2 = float(str_to_num(angles1))    steamid = get_user_authid(id,authid,32)

or this
Code:
public makecar(id) {    new item[32], orig1[6], orig2[6], orig3[6], angles1[6], Float:origin[3], steamid[33]    read_argv(1, item, 31)    read_argv(2, orig1, 5)    read_argv(3, orig2, 5)    read_argv(4, orig3, 5)    read_argv(5, angles1, 5)    read_argv(6, steamid, 32)    origin[0] = float(str_to_num(orig1))    origin[1] = float(str_to_num(orig2))    origin[2] = float(str_to_num(orig3))    new Float:angles2 = float(str_to_num(angles1))    steamid[33] = get_user_authid(id,authid,32)
[/small]
wonsae is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-13-2006 , 17:30  
Reply With Quote #10

OK I got it down to 3 errors

Code:
public makecar(id) {     new item[32], orig1[6], orig2[6], orig3[6], angles1[6], Float:origin[3], steamid[33]     read_argv(1, item, 31)     read_argv(2, orig1, 5)     read_argv(3, orig2, 5)     read_argv(4, orig3, 5)     read_argv(5, angles1, 5)     read_argv(6, steamid, 32)             origin[0] = float(str_to_num(orig1))     origin[1] = float(str_to_num(orig2))     origin[2] = float(str_to_num(orig3))     new Float:angles2 = float(str_to_num(angles1))     new steamid[33] = get_user_authid(id,steamid,32)

errors are


Code:
Error: Symbol already defined: "steamid" on line 67
Error: Must be a constant expression; assumed zero on line 67
Warning: Symbol is assigned a value that is never used: "steamid" on line 103

[/code]
wonsae is offline
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 20:27.


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