[HELP] fatal error 102: table overflow: "staging buffer"
#1

I'm getting fatal error 102: table overflow: "staging buffer" where this lines start:

pawn Код:
public SetPlayerGender(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(GetPlayerSkin(playerid) == 1 || GetPlayerSkin(playerid) == 2 || GetPlayerSkin(playerid) == 7 ||
        GetPlayerSkin(playerid) == 14 || GetPlayerSkin(playerid) == 15 || GetPlayerSkin(playerid) == 16 ||
        GetPlayerSkin(playerid) == 17 || GetPlayerSkin(playerid) == 18 || GetPlayerSkin(playerid) == 19 ||
        GetPlayerSkin(playerid) == 20 || GetPlayerSkin(playerid) == 21 || GetPlayerSkin(playerid) == 22 ||
        GetPlayerSkin(playerid) == 23 || GetPlayerSkin(playerid) == 25 || GetPlayerSkin(playerid) == 25 ||
        GetPlayerSkin(playerid) == 26 || GetPlayerSkin(playerid) == 27 || GetPlayerSkin(playerid) == 28 ||
        GetPlayerSkin(playerid) == 29 || GetPlayerSkin(playerid) == 30 || GetPlayerSkin(playerid) == 32 ||
        GetPlayerSkin(playerid) == 33 || GetPlayerSkin(playerid) == 34 || GetPlayerSkin(playerid) == 35 ||
        GetPlayerSkin(playerid) == 36 || GetPlayerSkin(playerid) == 37 || GetPlayerSkin(playerid) == 43 ||
        GetPlayerSkin(playerid) == 44 || GetPlayerSkin(playerid) == 45 || GetPlayerSkin(playerid) == 46 ||
        GetPlayerSkin(playerid) == 47 || GetPlayerSkin(playerid) == 48 || GetPlayerSkin(playerid) == 49 ||
        GetPlayerSkin(playerid) == 50 || GetPlayerSkin(playerid) == 51 || GetPlayerSkin(playerid) == 52 ||
        GetPlayerSkin(playerid) == 57 || GetPlayerSkin(playerid) == 58 || GetPlayerSkin(playerid) == 59 ||
        GetPlayerSkin(playerid) == 60 || GetPlayerSkin(playerid) == 61 || GetPlayerSkin(playerid) == 62 ||
        GetPlayerSkin(playerid) == 66 || GetPlayerSkin(playerid) == 68 || GetPlayerSkin(playerid) == 70 ||
        GetPlayerSkin(playerid) == 71 || GetPlayerSkin(playerid) == 72 || GetPlayerSkin(playerid) == 73 ||
        GetPlayerSkin(playerid) == 78 || GetPlayerSkin(playerid) == 79 || GetPlayerSkin(playerid) == 80 ||
        GetPlayerSkin(playerid) == 81 || GetPlayerSkin(playerid) == 82 || GetPlayerSkin(playerid) == 83 ||
        GetPlayerSkin(playerid) == 84 || GetPlayerSkin(playerid) == 95 || GetPlayerSkin(playerid) == 96 ||
        GetPlayerSkin(playerid) == 97 || GetPlayerSkin(playerid) == 98 || GetPlayerSkin(playerid) == 99 ||
        GetPlayerSkin(playerid) == 100 || GetPlayerSkin(playerid) == 101 || GetPlayerSkin(playerid) == 102 ||
        GetPlayerSkin(playerid) == 103 || GetPlayerSkin(playerid) == 104 || GetPlayerSkin(playerid) == 105 ||
        GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107 || GetPlayerSkin(playerid) == 108 ||
        GetPlayerSkin(playerid) == 109 || GetPlayerSkin(playerid) == 110 || GetPlayerSkin(playerid) == 111 ||
        GetPlayerSkin(playerid) == 112 || GetPlayerSkin(playerid) == 113 || GetPlayerSkin(playerid) == 114 ||
        GetPlayerSkin(playerid) == 115 || GetPlayerSkin(playerid) == 116 || GetPlayerSkin(playerid) == 117 ||
        GetPlayerSkin(playerid) == 118 || GetPlayerSkin(playerid) == 119 || GetPlayerSkin(playerid) == 120 ||
        GetPlayerSkin(playerid) == 121 || GetPlayerSkin(playerid) == 122 || GetPlayerSkin(playerid) == 123 ||
        GetPlayerSkin(playerid) == 124 || GetPlayerSkin(playerid) == 125 || GetPlayerSkin(playerid) == 126 ||
        GetPlayerSkin(playerid) == 127 || GetPlayerSkin(playerid) == 128 || GetPlayerSkin(playerid) == 133 ||
        GetPlayerSkin(playerid) == 134 || GetPlayerSkin(playerid) == 135 || GetPlayerSkin(playerid) == 136 ||
        GetPlayerSkin(playerid) == 137 || GetPlayerSkin(playerid) == 142 || GetPlayerSkin(playerid) == 143 ||
        GetPlayerSkin(playerid) == 146 || GetPlayerSkin(playerid) == 147 || GetPlayerSkin(playerid) == 153 ||
        GetPlayerSkin(playerid) == 154 || GetPlayerSkin(playerid) == 155 || GetPlayerSkin(playerid) == 156 ||
        GetPlayerSkin(playerid) == 158 || GetPlayerSkin(playerid) == 159 || GetPlayerSkin(playerid) == 160 ||
        GetPlayerSkin(playerid) == 161 || GetPlayerSkin(playerid) == 162 || GetPlayerSkin(playerid) == 163 ||
        GetPlayerSkin(playerid) == 164 || GetPlayerSkin(playerid) == 165 || GetPlayerSkin(playerid) == 166 ||
        GetPlayerSkin(playerid) == 167 || GetPlayerSkin(playerid) == 168 || GetPlayerSkin(playerid) == 170 ||
        GetPlayerSkin(playerid) == 171 || GetPlayerSkin(playerid) == 173 || GetPlayerSkin(playerid) == 174 ||
        GetPlayerSkin(playerid) == 175 || GetPlayerSkin(playerid) == 176 || GetPlayerSkin(playerid) == 177 ||
        GetPlayerSkin(playerid) == 179 || GetPlayerSkin(playerid) == 180 || GetPlayerSkin(playerid) == 181 ||
        GetPlayerSkin(playerid) == 182 || GetPlayerSkin(playerid) == 183 || GetPlayerSkin(playerid) == 184 ||
        GetPlayerSkin(playerid) == 185 || GetPlayerSkin(playerid) == 186 || GetPlayerSkin(playerid) == 187 ||
        GetPlayerSkin(playerid) == 188 || GetPlayerSkin(playerid) == 189 || GetPlayerSkin(playerid) == 200 ||
        GetPlayerSkin(playerid) == 202 || GetPlayerSkin(playerid) == 203 || GetPlayerSkin(playerid) == 204 ||
        GetPlayerSkin(playerid) == 206 || GetPlayerSkin(playerid) == 209 || GetPlayerSkin(playerid) == 210 ||
        GetPlayerSkin(playerid) == 212 || GetPlayerSkin(playerid) == 213 || GetPlayerSkin(playerid) == 217 ||
        GetPlayerSkin(playerid) == 220 || GetPlayerSkin(playerid) == 221 || GetPlayerSkin(playerid) == 222 ||
        GetPlayerSkin(playerid) == 223 || GetPlayerSkin(playerid) == 227 || GetPlayerSkin(playerid) == 228 ||
        GetPlayerSkin(playerid) == 229 || GetPlayerSkin(playerid) == 230 || GetPlayerSkin(playerid) == 234 ||
        GetPlayerSkin(playerid) == 235 || GetPlayerSkin(playerid) == 236 || GetPlayerSkin(playerid) == 239 ||
        GetPlayerSkin(playerid) == 240 || GetPlayerSkin(playerid) == 241 || GetPlayerSkin(playerid) == 242 ||
        GetPlayerSkin(playerid) == 247 || GetPlayerSkin(playerid) == 248 || GetPlayerSkin(playerid) == 249 ||
        GetPlayerSkin(playerid) == 250 || GetPlayerSkin(playerid) == 252 || GetPlayerSkin(playerid) == 253 ||
        GetPlayerSkin(playerid) == 254 || GetPlayerSkin(playerid) == 255 || GetPlayerSkin(playerid) == 258 ||
        GetPlayerSkin(playerid) == 259 || GetPlayerSkin(playerid) == 260 || GetPlayerSkin(playerid) == 261 ||
        GetPlayerSkin(playerid) == 262 || GetPlayerSkin(playerid) == 264 || GetPlayerSkin(playerid) == 265 ||
        GetPlayerSkin(playerid) == 266 || GetPlayerSkin(playerid) == 267 || GetPlayerSkin(playerid) == 269 ||
        GetPlayerSkin(playerid) == 270 || GetPlayerSkin(playerid) == 271 || GetPlayerSkin(playerid) == 272 ||
        GetPlayerSkin(playerid) == 274 || GetPlayerSkin(playerid) == 275 || GetPlayerSkin(playerid) == 276 ||
        GetPlayerSkin(playerid) == 277 || GetPlayerSkin(playerid) == 278 || GetPlayerSkin(playerid) == 279 ||
        GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 ||
        GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285 ||
        GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 287 || GetPlayerSkin(playerid) == 288 ||
        GetPlayerSkin(playerid) == 290 || GetPlayerSkin(playerid) == 291 || GetPlayerSkin(playerid) == 292 ||
        GetPlayerSkin(playerid) == 293 || GetPlayerSkin(playerid) == 294 || GetPlayerSkin(playerid) == 295 ||
        GetPlayerSkin(playerid) == 296 || GetPlayerSkin(playerid) == 297 || GetPlayerSkin(playerid) == 299)
        {
            PlayerInfo[playerid][pGender] = 1;
        }
    }
    return 1;
}
Reply
#2

I think you are calling too many functions, try making an array with all the skins you want and then check if player has one of them.
Reply
#3

I'm pretty sure it's due to you using like 300 GetPlayerSkin's in one if statement. The best way to do what you are doing, is create an array with all the skin id's then make a loop.

pawn Код:
new skinarray[] = {1, 2, 3, 4, 5}; //Add all the skins you want in here. Or you could do all the ones you don't want and do opposite processing.

public SetPlayerGender(playerid)
{
    new skin = GetPlayerSkin(playerid);
    for(new x; x<sizeof(skinarray); x++)
    {
        if(skin == skinarray[x]) PlayerInfo[playerid][pGender] = 1;
    }
    return 1;
}
Reply
#4

This is what I've created as a start:

pawn Код:
new maleskins[] = {1, 2, 7};
new femaleskins[] = {9, 10, 11};

public SetPlayerGender(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        new skin = GetPlayerSkin(playerid);
        for(new x; x<sizeof(maleskins); x++)
        {
            if(skin == maleskins[x]) PlayerInfo[playerid][pGender] = 1;
        }
        for(new x; x<sizeof(femaleskins); x++)
        {
            if(skin == femaleskins[x]) PlayerInfo[playerid][pGender] = 2;
        }
    }
    return 1;
}
EDIT: The female skin function works but if I try to switch to a male skin, for example skin ID 1 it stays on Gender 2.
Reply
#5

Took me a while to find it

http://forum.sa-mp.com/showpost.php?...postcount=1776
Reply
#6

Bumping this, I'm still in need of assistance with this:

pawn Код:
forward SetPlayerGender(playerid);

new maleskins[] = {1, 2, 7};
new femaleskins[] = {9, 10, 11};

public OnPlayerSpawn(playerid)
{
    SetPlayerGender(playerid);
}

public SetPlayerGender(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        new skin = GetPlayerSkin(playerid);
        for(new x; x<sizeof(maleskins); x++)
        {
            if(skin == maleskins[x]) PlayerInfo[playerid][pGender] = 1;
        }
        for(new x; x<sizeof(femaleskins); x++)
        {
            if(skin == femaleskins[x]) PlayerInfo[playerid][pGender] = 2;
        }
        return 1;
    }
    return 1;
}
Reply
#7

This works. Gender ID 1 = male, 2 = female

Код:
public SetPlayerGender(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        new skin = GetPlayerSkin(playerid);
        for(new x; x<sizeof(maleskins); x++)
        {
            if(skin == maleskins[x]) Gender[playerid] = 1;
        }
        for(new x; x<sizeof(femaleskins); x++)
        {
            if(skin == femaleskins[x])  Gender[playerid] = 2;
        }
    }
    return 1;
}
Reply
#8

No, it doesn't work. If I connect and I pick a female skin, it works. But if I later decide to pick a male skin from the skin selection it doesn't change from Gender 2 to Gender 1.
Reply
#9

It does for me. Note that I am using different variable for it.

The whole script, works:

Код:
forward SetPlayerGender(playerid);

new maleskins[] = {1, 2, 7};
new femaleskins[] = {9, 10, 11};
new Gender[MAX_PLAYERS];


public OnPlayerSpawn(playerid)
{
    SetPlayerGender(playerid);
    return 1;
}


public SetPlayerGender(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        new skin = GetPlayerSkin(playerid);
        for(new x; x<sizeof(maleskins); x++)
        {
            if(skin == maleskins[x]) Gender[playerid] = 1;
        }
        for(new x; x<sizeof(femaleskins); x++)
        {
            if(skin == femaleskins[x])  Gender[playerid] = 2;
        }
    }
    return 1;
}


CMD:gender(playerid, params[])
{
	new string[48];
	format(string, sizeof(string), "Your gender is %i".", Gender[playerid]);
	SendClientMessage(playerid, -1, string);
	return 1;
}
Reply
#10

I don't see a reason to loop twice. Just loop once (use one for-statement) and if gender one doesn't get set by that, assign the other gender!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)