Infinite Skins With for(CivSkins) OnGameModeInit - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Infinite Skins With for(CivSkins) OnGameModeInit (
/showthread.php?tid=70592)
Infinite Skins With for(CivSkins) OnGameModeInit -
tom_jonez - 25.03.2009
So im trying to get this script to auto add these skins. So heres what i got under OnGameModeInit:
Код:
for(new i = 0; i < sizeof(CivSkins); i++)
{
for(new b = 0; b < sizeof(BadSkins); b++)
{
if(BadSkins[b] != CivSkins[i])
{
AddPlayerClass(CivSkins[i],2028.8048,1551.5974,26.5878,90.0,0,0,0,0,0,0);
}
else
{
printf("WARNING: Bad skin detected. ID %d.",CivSkins[i]);
}
}
}
Here is my two arrays.
Код:
new BadSkins[15] =
{
3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289
};
new CivSkins[4] =
{
271,
270,
269,
272
};
But when i open the game up and join, the skins load, but there are like 20 of each.... What is wrong with it?
Re: Infinite Skins With for(CivSkins) OnGameModeInit -
ICECOLDKILLAK8 - 26.03.2009
You are creating a loop inside a loop, Therefore its firing
pawn Код:
if(BadSkins[b] != CivSkins[i])
{
AddPlayerClass(CivSkins[i],2028.8048,1551.5974,26.5878,90.0,0,0,0,0,0,0);
}
else
{
printf("WARNING: Bad skin detected. ID %d.",CivSkins[i]);
}
20 times as its inside the loop of BadSkins which is equal to 20, Also no skins inside of CivSkins are bad skins, So why check smthing that you can see is okay
Re: Infinite Skins With for(CivSkins) OnGameModeInit -
tom_jonez - 26.03.2009
Ok, i see where you're coming from. Umm, im thinking it through right now and im not quite sure i know how to fix this. Tips?
Re: Infinite Skins With for(CivSkins) OnGameModeInit -
tom_jonez - 26.03.2009
Thanks guys