onplayerspawn sees the first thing in the callback, and skips the rest -_-
#1

hey everyone,

i made it that when a player comes at classselection, he can choose drift world and stunt world, but the problem is, when at spawning, it retrieves the info it has saved at ondialogresponse, which is StuntWorld if player did stuntworld, and DriftWorld if player selected driftworld,
but now at the onplayerspawn, i found out it only does the first one it sees
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][World] == DriftWorld)
    {
        new skin;
        new file[300];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(file,sizeof(file),"nAdmin/Users/%s.ini",name);
        skin = dini_Int(file, "Skin");
        SetPlayerSkin(playerid, skin);
        new Rand = random(sizeof(RandomSpawnsDriftWorld));
        SetPlayerPos(playerid, RandomSpawnsDriftWorld[Rand][0], RandomSpawnsDriftWorld[Rand][1], RandomSpawnsDriftWorld[Rand][2]);
        SetPlayerInterior(playerid, 0);
        SetWorld(playerid, "DriftWorld");
        SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
        GameTextForPlayer(playerid,"~g~Waiting for the Environment to load",2000,3);
        SendClientMessage(playerid, COLOR_WHITE, "Spawned at random drift places");
    }
    else if(PlayerInfo[playerid][World] == StuntWorld)
    {
        new skin;
        new file[300];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(file,sizeof(file),"nAdmin/Users/%s.ini",name);
        skin = dini_Int(file, "Skin");
        SetPlayerSkin(playerid, skin);
        new Random = random(sizeof(RandomSpawnsStuntWorld));
        SetPlayerPos(playerid, RandomSpawnsStuntWorld[Random][0], RandomSpawnsStuntWorld[Random][1], RandomSpawnsStuntWorld[Random][2]);
        SetPlayerInterior(playerid, 0);
        SetWorld(playerid, "StuntWorld");
        SetTimerEx("Unfreeze", 2000, 0, "d", playerid);
        GameTextForPlayer(playerid,"~g~Waiting for the Environment to load",2000,3);
        SendClientMessage(playerid, COLOR_WHITE, "Spawned at random stunt places");
    }
    return 1;
}
so here it picks the driftworld as first, and skips the stunt world...

if i change the things, and put stuntworld in front and driftworld under it, it picks stuntworld, and skips driftworld...

anyone knows how to make it that it WILL select the selected world, instead of just picking the first one it sees?

greets niels
Reply


Messages In This Thread
onplayerspawn sees the first thing in the callback, and skips the rest -_- - by niels44 - 01.11.2012, 19:38
Re: onplayerspawn sees the first thing in the callback, and skips the rest -_- - by niels44 - 01.11.2012, 19:58
Re: onplayerspawn sees the first thing in the callback, and skips the rest -_- - by FUNExtreme - 01.11.2012, 20:06
Re: onplayerspawn sees the first thing in the callback, and skips the rest -_- - by niels44 - 01.11.2012, 20:16

Forum Jump:


Users browsing this thread: 2 Guest(s)