Pawn crashes on random player skins!!
#1

Here is some problem....
I don't get why its crashes...
pawn Код:
new Male[] = {
101,136,14,142,143,15,156,17,170,180,182,183,184,186,185,188,19,20,206,21,22,
210,220,221,222,223,227,24,240,25,250,28,35,37,44,43,46,48,47,58,59,60,67,7,72,98
};
new Female[] = {
12,13,169,263,216,40,41,225,226,214,215,76,56,55,233,232,93,9,69
};
new rand = random(sizeof(Male));
new ferand = random(sizeof(Female));
Here is the second part of code!
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][Sex] == 0)
    {
        SetPlayerSkin(playerid, Male[rand][]);
    }
    if(pInfo[playerid][Sex] == 1)
    {
        SetPlayerSkin(playerid, Female[ferand][]);
    }
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][Sex] == 0)
    {
        SetPlayerSkin(playerid, Male[rand]);
    }
    if(pInfo[playerid][Sex] == 1)
    {
        SetPlayerSkin(playerid, Female[ferand]);
    }
    return 1;
}
Reply
#3

You can't use functions outside a function/callback.

Remove this:

pawn Код:
new rand = random(sizeof(Male));
new ferand = random(sizeof(Female));
And change this here:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][Sex] == 0)
    {
        SetPlayerSkin(playerid, Male[random(sizeof(Male))]);
    }
    if(pInfo[playerid][Sex] == 1)
    {
        SetPlayerSkin(playerid, Female[random(sizeof(Female))]);
    }
    return 1;
}
Reply
#4

MP2 saved the day ... That maked sence.. Just big thanks to you Again..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)