Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new CintoPlayer[MAX_PLAYERS];
- forward Levantar(playerid);
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- if(CintoPlayer[playerid] == 0)
- {
- new Float:Posx,
- Float:Posy,
- Float:Posz,
- Float:Vida;
- if(GetPlayerSpeed(playerid) >= 10 || GetPlayerSpeed(playerid) <= 60) {
- GetVehicleHealth(vehicleid,Vida);
- SetPlayerHealth(playerid,Vida-10);
- SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o carro e perdeu Vida");
- }
- if(GetPlayerSpeed(playerid) > 60 || GetPlayerSpeed(playerid) <= 120) {
- GetVehicleHealth(vehicleid,Vida);
- SetPlayerHealth(playerid,Vida-30);
- GetPlayerPos(playerid, Posx, Posy, Posz);
- SetPlayerPos(playerid,Posx+1,Posy+1,Posz+0.5);
- RemovePlayerFromVehicle(playerid);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o Carro e Saiu Voando!");
- SetTimerEx("Levantar", 5000, false, "i", playerid);
- }
- if(GetPlayerSpeed(playerid) > 120) {
- GetVehicleHealth(vehicleid,Vida);
- SetPlayerHealth(playerid,Vida-60);
- GetPlayerPos(playerid, Posx, Posy, Posz);
- SetPlayerPos(playerid,Posx+4,Posy+4,Posz+2);
- RemovePlayerFromVehicle(playerid);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- SendClientMessage(playerid, 0xFF0000B9, "[AVISO]: Você estava sem Cinto, Bateu o Carro e Saiu Voando!");
- SetTimerEx("Levantar", 5000, false, "i", playerid);
- }
- }
- return 1;
- }
- public Levantar(playerid)
- {
- ClearAnimations(playerid);
- return 1;
- }
- stock GetPlayerSpeed(playerid)
- {
- new Float:ST[4]; //by Alguem, So sei que não fui eu '-'
- if(IsPlayerInAnyVehicle(playerid))
- GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
- else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
- ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
- return floatround(ST[3]);
- }
Advertisement
Add Comment
Please, Sign In to add comment