28.11.2016, 05:24
Hey guys, I'm trying to use an array and go through specific values so that when I call the function the next value in the array gets SetPlayerSkin.
I don't know if that makes any sense. Basically I'm making a script that whenever called it gets the next value in the array and then sets the player's skin to the value. However I'm getting error's and I don't quite understand what I'm meant to do. I've read Vince's tutorial about Looping through arrays.
https://sampforum.blast.hk/showthread.php?tid=301933
However whenever he does it he uses an enum and I'm not so when I'm using my array I don't know what value to put in as I keep getting
I hope this is making sense
Here is my array:
These are the female skin ids.
Then here is where i'm calling it. I've removed everything apart from the loop for you guys just to look at the loop.
So in summary I'm getting the error
On this line
As I'm new to arrays and I'm not quite sure how they work without an enum.
I don't know if that makes any sense. Basically I'm making a script that whenever called it gets the next value in the array and then sets the player's skin to the value. However I'm getting error's and I don't quite understand what I'm meant to do. I've read Vince's tutorial about Looping through arrays.
https://sampforum.blast.hk/showthread.php?tid=301933
However whenever he does it he uses an enum and I'm not so when I'm using my array I don't know what value to put in as I keep getting
Код:
error 035: argument type mismatch (argument 2)

PHP код:
static const FemaleSkins[78][] =
{
{9},{10},{11},{12},{13},{31},{39},{40},{41},{53},{54},{55},{56},{63},{64},{65},{69},{75},{76},{77},{85},{87},{88},{89},{90},{91},{93},{129},{130},{131},//30
{138},{129},{140},{141},{145},{148},{150},{151},{142},{157},{169},{172},{178},{190},{191},{192},{193},{194},{195},{196},{197},{198},{199},{201},//54
{205},{207},{214},{215},{216},{218},{219},{224},{225},{226},{231},{232},{233},{237},{238},{243},{244},{245},{246},{251},{256},{257},{263},{298}//78
};
Then here is where i'm calling it. I've removed everything apart from the loop for you guys just to look at the loop.
PHP код:
public PlusSkin(playerid)
{
......
for(new i; i < sizeof(FemaleSkins[]); i++)
{
SetPlayerSkin(playerid, FemaleSkins[i]);
}
....
}
.....
return 1;
}
Код:
error 035: argument type mismatch (argument 2)
PHP код:
SetPlayerSkin(playerid, FemaleSkins[i]);