Raised This Month: $ Target: $400
 0% 

Arrays


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hellspawn
Junior Member
Join Date: Jun 2005
Old 03-17-2006 , 22:32   Arrays
Reply With Quote #1

I have this code:
Code:
    read_argv(3,arg3,31) 
    read_argv(4,arg4,31) 
    modelname = arg
    x = str_to_num(arg2) 
    y = str_to_num(arg3) 
    z = str_to_num(arg4) 
    
    if(modelname == 0) { 
        return PLUGIN_HANDLED 
    } 
    server_cmd("amx_makecar %s %i  %i %i",modelname, x, y, z) 
    return PLUGIN_HANDLED 
}
It should work fine but it came up with the compiling error of:
makecar.sma<21 -- 22> : error 006:must be assigned to an array.

I have tried assigning it but i am new and don't know how to fix these problems if someone could get this into a compilable plugin that would be great!
Hellspawn is offline
BAILOPAN
Join Date: Jan 2004
Old 03-17-2006 , 22:34  
Reply With Quote #2

I'm not quite sure what you're trying to do but you can't "copy" strings like that. You have to do:

Code:
new arg1[32], modelname[32] copy(modelname, 31, arg1)
__________________
egg
BAILOPAN is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 03-17-2006 , 22:46  
Reply With Quote #3

also modelname is not even defined as a string/array
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
BlueThunder2k
Senior Member
Join Date: Aug 2004
Location: Australia
Old 03-18-2006 , 01:00  
Reply With Quote #4

if i am not mistaken he is trying to get the plugin so in his sql he can put

item_car <id> "carname here eg:car_skyline" "x" "y" "z"
__________________
Glow worms are never glum because the sun shines out their bum
f[/img]
BlueThunder2k is offline
Send a message via AIM to BlueThunder2k Send a message via MSN to BlueThunder2k Send a message via Yahoo to BlueThunder2k
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 16:41.


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