spawn choosing
#1

hi. i haz a question.
how i can make spawn choosing like grandlarency?
i tried from grandlarency code:

pawn Код:
ClassSel_SwitchToNextCity(playerid)
{
    gPlayerCitySelection[playerid]++;
    if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
        gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
    }
    PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
    gPlayerLastCitySelectionTick[playerid] = GetTickCount();
    ClassSel_SetupSelectedCity(playerid);
}

//----------------------------------------------------------

ClassSel_SwitchToPreviousCity(playerid)
{
    gPlayerCitySelection[playerid]--;
    if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
        gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
    }
    PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
    gPlayerLastCitySelectionTick[playerid] = GetTickCount();
    ClassSel_SetupSelectedCity(playerid);
}
and here is my edited code:

pawn Код:
ClassSel_SwitchToNextSpawn(playerid)
{
    gPlayerSpawnSelection[playerid]++;
    if(gPlayerSpawnSelection[playerid] > SPAWN_FARMER) {
        gPlayerSpawnSelection[playerid] = SPAWN_SECURITY;
    }
    if(gPlayerSpawnSelection[playerid] > SPAWN_MEDIC) {
        gPlayerSpawnSelection[playerid] = SPAWN_FARMER;
    }
    else if(gPlayerSpawnSelection[playerid] > SPAWN_GUN_DEALER) {
        gPlayerSpawnSelection[playerid] = SPAWN_MEDIC;
    }
    else if(gPlayerSpawnSelection[playerid] > SPAWN_POLICE) {
        gPlayerSpawnSelection[playerid] = SPAWN_GUN_DEALER;
    }
    else if(gPlayerSpawnSelection[playerid] > SPAWN_RACER) {
        gPlayerSpawnSelection[playerid] = SPAWN_POLICE;
    }
    PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
    gPlayerLastSpawnSelectionTick[playerid] = GetTickCount();
    ClassSel_SetupSelectedSpawn(playerid);
}

ClassSel_SwitchToPreviousSpawn(playerid)
{
    gPlayerSpawnSelection[playerid]--;
    if(gPlayerSpawnSelection[playerid] < SPAWN_SECURITY) {
        gPlayerSpawnSelection[playerid] = SPAWN_FARMER;
    }
    else if(gPlayerSpawnSelection[playerid] < SPAWN_FARMER) {
        gPlayerSpawnSelection[playerid] = SPAWN_MEDIC;
    }
    else if(gPlayerSpawnSelection[playerid] < SPAWN_MEDIC) {
        gPlayerSpawnSelection[playerid] = SPAWN_GUN_DEALER;
    }
    else if(gPlayerSpawnSelection[playerid] < SPAWN_GUN_DEALER) {
        gPlayerSpawnSelection[playerid] = SPAWN_POLICE;
    }
    else if(gPlayerSpawnSelection[playerid] < SPAWN_POLICE) {
        gPlayerSpawnSelection[playerid] = SPAWN_RACER;
    }
    PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
    gPlayerLastSpawnSelectionTick[playerid] = GetTickCount();
    ClassSel_SetupSelectedSpawn(playerid);
}
but it worked shitty so response please if you know how to fix this.
and i need to work it smth like OnPlayerRequestClass.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)