17.04.2017, 12:48
Hi. So I'm working on updating my vehicle system. I decided to a few things better this time. One of those is to change the way I store mods. I used the old fashion method of using 'mod1', 'mod2'... etc. To store vehicle components. I've read Vince's post On storing Vehicle components, And I think it is a great way to do so. But I'm experimenting with something and need your opinion on it. Here is the code:
And here is the output:
The string is just an example, Instead of 1234, It would be the component id of the vehicle mod. I plan to use this as a string it self and use strval(); in the script. The code work okay, But I wanted to know some things.
Is this a good idea? What are the pros and cons of using this method?
Thanks
PHP код:
new string[69], mods[17][5], count1;
format(string, sizeof(string), "12345678912345678912345678912345678912345678912345678912345678912345");
print(string);
for(new i; i < sizeof(mods); i++) {
strmid(mods[i], string, count1, count1+4);
printf("mod%i: %s", i,mods[i]);
count1 = count1+4;
}
The string is just an example, Instead of 1234, It would be the component id of the vehicle mod. I plan to use this as a string it self and use strval(); in the script. The code work okay, But I wanted to know some things.
Is this a good idea? What are the pros and cons of using this method?
Thanks