AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Arrays (https://forums.alliedmods.net/showthread.php?t=25650)

Hellspawn 03-17-2006 22:32

Arrays
 
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!

BAILOPAN 03-17-2006 22:34

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)

jtp10181 03-17-2006 22:46

also modelname is not even defined as a string/array

BlueThunder2k 03-18-2006 01:00

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"


All times are GMT -4. The time now is 16:41.

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