Raised This Month: $ Target: $400
 0% 

Solved help with enum and strings.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sebu
New Member
Join Date: Oct 2022
Old 10-01-2022 , 06:25   help with enum and strings.
Reply With Quote #1

Hello, i have been trying to modify a script i have on my gamemode to change the license plates from LS-(Vehicleid) to random numbers and letters (ex: 1asd123 like california kind of thing) but i came across a wall i cant get around.

When a vehicle is purchased is saved into a config file using an enum, thing is i cant add an string into that thing because error 006.

Here is the partial code.

#####
enum vInfo
{
vID,
vLicensePlate,
......
#########

↓ down here is part of the code from the stock() when you buy a vehicle.

###############################
//define lic random
new numberplate[12];
format(numberplate, sizeof(numberplate), "%c%c%c%c%c%c%c", RandomEx('1','9'), RandomEx('A','Z'), RandomEx('A','Z'), RandomEx('A','Z'), RandomEx('1','9'), RandomEx('1','9'), RandomEx('1','9'));
//define lic random

i_Vehicle[vid][vLicensePlate] = numberplate;
############################################# ################

i know "numberplate" alone there isnt enough i have 2 do something else but i cant figure it out, i tried adding " ", also tried making a stock but everything ends with an error of "error 006: must be assigned to an array" i get it, thats not an array but i cant come with another way to save the info in the same file.


if anyone has an idea and wants to share it, i would appreciate it, thanks in advance.

Last edited by sebu; 10-01-2022 at 11:37. Reason: fixed
sebu is offline
 



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:42.


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