Loop AddPlayerClass
#1

I created a loop for my skin ClassSelection with the array SKINS, more does not work, the selection screen skin, did not appear the way I want, in order as the array, and the skins that are in the array, the code below

// array
new skins[52][1]={
{285},{284},{288},{282},{276},{274},{210},{193},{1 94},{192},{190},{138},{139},
{140},{146},{154},{97},{45},{18},{128},{133},{202} ,{33},{161},{198},{23},{81},
{80},{26},{96},{167},{11},{141},{148},{179},{203}, {217},{260},{27},{70},{101},
{142},{144},{170},{180},{184},{263},{75},{188},{19 },{214},{206}
};

//loop

for(new x; x < sizeof(skins); x++)
{
AddPlayerClass(x,...);
}
Reply
#2

You dont need an extra dimension: http://forum.sa-mp.com/index.php?top....0#post_excess
Код:
new skins[52] = 
{
  285, 284, 288, 282, 276, ...
};
This code..
Код:
for(new x; x < sizeof(skins); x++)
{
  AddPlayerClass(x, ...);
}
..adds skin ids 0-51.

This..
Код:
for(new x; x < sizeof(skins); x++)
{
  AddPlayerClass(skins[x], ...);
}
..would add skin ids you want.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)