new fload: etc..
#1

Код:
public SetPlayerSkinRandom
{
	new rand = random(sizeof(gSkins));
	SetPlayerSkin(playerid, gSkins[rand][0]);
}
Код:
new Float:gSkins[12][0] = {
{280},
{281},
{282},
{283},
{284},
{285},
{286},
{287},
{288},
{289},
{290},
{105}
};
is this ok to do ?
my pawn crashes after this
Reply
#2

pawn Код:
public SetPlayerSkinRandom() //there were no (). That was causing the crash
{
    new rand = random(sizeof(gSkins));
    SetPlayerSkin(playerid, gSkins[rand]);
}
pawn Код:
new Float:gSkins[12] = { 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 105};
Reply
#3

What do you write that
Код:
[0]
for? Why not
Код:
[0][0][0]
?
It isn't needed. Also, the compiler does know how many elemnts in array if you initialize it when you declare it and wrong number may cause errors on compiling. So just do
pawn Код:
new gSkins[] = { 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 105};
And are you sure you need FLoat: ? I'm asking this because those numbers are integer...
Reply
#4

solved it thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)