[Ajuda] Zumbis nгo dirigem + Alarme
#5

Quote:
Originally Posted by zSuYaNw
Посмотреть сообщение
Уtimo uso do static... mas pode ser mais otimizado

pawn Код:
public OnGameModeInit() {

    static i;


    // Percorrer em todos os veнculos EXISTENTES!
     for ( i = 1; GetVehicleModel(i) ^ 0; ++i ) {
        SetVehicleParamsEx(i, 1, 1, 1, 1, 0, 0, 0);
    }
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate) {

    static
        engine,lights,alarm,doors,bonnet,boot,objective,vehicleid
    ;


    vehicleid = GetPlayerVehicleID(playerid);

    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) {

        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, 0, doors, bonnet, boot, objective);
    }

    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT){
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, 1, doors, bonnet, boot, objective);
    }
    return 1;
}


Lembrando que quando o jogador estiver a pй nгo й possнvel "getar" o ID do veнculo como foi feito acima.

Quote:
Originally Posted by eNtinityGaming
Посмотреть сообщение
cara deu varios warnings tipo numers of matchin sei la do que na linha do for i algo assim, ai eu troquei de i para ii
vai dar problema? (resolveu os warnings)
Poste as linhas relacionadas aos erros/warings, assim fica mais fбcil lhe ajudar.
Reply


Messages In This Thread
Zumbis nгo dirigem + Alarme - by eNtinityGaming - 09.02.2014, 04:57
Re: Zumbis nгo dirigem + Alarme - by Gii - 09.02.2014, 05:18
Re: Zumbis nгo dirigem + Alarme - by zSuYaNw - 09.02.2014, 07:19
Respuesta: Zumbis nгo dirigem + Alarme - by eNtinityGaming - 09.02.2014, 12:27
Re: Respuesta: Zumbis nгo dirigem + Alarme - by Gii - 09.02.2014, 12:39
Re: Respuesta: Zumbis nгo dirigem + Alarme - by yNexus - 09.02.2014, 12:44
Respuesta: Zumbis nгo dirigem + Alarme - by eNtinityGaming - 10.02.2014, 19:04

Forum Jump:


Users browsing this thread: 2 Guest(s)