Array sizes etc. etc.
#1

Alright, I want my array variable being set to the variable "plate"

Like this

pawn Код:
//inside the array:

 VehPlate[22],


//In the thing command/dialog

new plate[20]
new num = RandomEx(100000,999999999);
format(plate, 20, "%d", num);
Vinfo[v][VehPlate] = plate;
;

I might be stupid or it might me a stupid mistake (Had an all-nighter, not really awake) but what is going wrong?

Код:
 error 047: array sizes do not match, or destination array is too small
Danke
Reply
#2

pawn Код:
format(Vinfo[v][VehPlate],22,"%s",plate);
Reply
#3

Ow wow, Im being stupid -.-
thanks anyway

No more allnighters for me when Im planning on scripting the next day -.-
Reply
#4

Actually I cant find a logic explanation why you are creating a new array plate and after formatting it, assign it to vInfo enum. Wouldnt this be more simple and easier?

pawn Код:
format(Vinfo[v][VehPlate], sizeof Vinfo[v][VehPlate], "%d", RandomEx(100000,999999999));
Reply
#5

Quote:
Originally Posted by Universal
Посмотреть сообщение
Actually I cant find a logic explanation why you are creating a new array plate and after formatting it, assign it to vInfo enum. Wouldnt this be more simple and easier?

pawn Код:
format(Vinfo[v][VehPlate], sizeof Vinfo[v][VehPlate], "%d", RandomEx(100000,999999999));
That will give an error, you cabra
Reply
#6

Quote:
Originally Posted by Universal
Посмотреть сообщение
Actually I cant find a logic explanation why you are creating a new array plate and after formatting it, assign it to vInfo enum. Wouldnt this be more simple and easier?

pawn Код:
format(Vinfo[v][VehPlate], sizeof Vinfo[v][VehPlate], "%d", RandomEx(100000,999999999));
he uses it in a command , so he must make a new variable (to split ,sscanf etc...) and then store it in Vinfo[v][VehPlate]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)