GetPlayerSkin?
#1

I'm having a problem setting spawn locations with the skin.....



How can I make this work?

I'm getting an error:

error 033: array must be indexed (variable "skin")


pawn Код:
new skin[MAX_PLAYERS];
        skin[playerid] = GetPlayerSkin(playerid);
        if(skin >= 19 && skin <= 64) {
    new rnd;
    SetPlayerFacingAngle(playerid, 88.6658);
    SetTimerEx("DialogTimeout", 60000, false, "i", playerid);
    rnd = random(sizeof (SpawnPoints));
    SetPlayerPos(playerid, SpawnPoints[rnd][0], SpawnPoints[rnd][1], SpawnPoints[rnd][2]);
    CanChooseSkill[playerid] = 1;
    TogglePlayerControllable(playerid, 0);
    SendClientMessage(playerid, 0x1E90FFAA, "Use /skill to pick a skill. If you don't pick one, you'll be given one automatically.");
    SendClientMessage(playerid, 0x1E90FFAA, "You have 60 seconds to pick a skill.");
  }
Reply
#2

change the
if(skin >= 19 && skin <= 64)
to
if(skin[playerid] >= 19 && skin[playerid] <= 64)

EDIT:
It would be better to change
pawn Код:
new skin[MAX_PLAYERS];
        skin[playerid] = GetPlayerSkin(playerid);
        if(skin >= 19 && skin <= 64) {
TO
pawn Код:
//remove the new skin and skin[playerid]=
        if(GetPlayerSkin(playerid) >= 19 && GetPlayerSkin(playerid) <= 64) {
Reply
#3

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)