SA-MP Forums Archive
Speed boost car exploding. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Speed boost car exploding. (/showthread.php?tid=303531)



Speed boost car exploding. - SnG.Scot_MisCuDI - 14.12.2011

Yo, i have a speed boost script when you use it the player who is using it there car explodes. But it really doesnt explode for them it just appears that way on another players screen. Idk if this is a bug or script error. But the player is driving a car, dead (for others) and the car is exploded. Here is the script.

pawn Код:
#include a_samp
new bool:speeding[MAX_PLAYERS];
public OnFilterScriptInit() return print("eBoost By Epsilon  ---   loaded"),1;
public OnFilterScriptExit() return print("eBoost By Epsilon  ---   unloaded"),1;
public OnPlayerConnect(playerid) return speeding[playerid] = false;
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/sb", cmdtext, true))
    {
        if(speeding[playerid]) speeding[playerid] = false; else speeding[playerid] = true;
        if(speeding[playerid]) return SendClientMessage(playerid,0x33AA33AA,"SpeedBoost Actived!"); else return SendClientMessage(playerid,0x33AA33AA,"SpeedBoost De-Activated!");
    }
    return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & 2 && GetPlayerState(playerid)-1 && speeding[playerid]) return BoostVeh(GetPlayerVehicleID(playerid)); else if (newkeys & 4 && GetPlayerState(playerid)-1 && speeding[playerid]) JumpVeh(GetPlayerVehicleID(playerid));
    return 1;
}
JumpVeh(vid, Float:dis = 0.3)
{
    new Float:T[3];
    GetVehicleVelocity(vid, T[0], T[1], T[2]);
    SetVehicleVelocity(vid, T[0], T[1], floatadd(T[2],dis));
    SetVehicleHealth(vid,floatpower(1500.84,16));
    return 1;
}
BoostVeh(vid, Float:dis = 0.24)
{
    new Float:T[4];
    GetVehicleVelocity(vid, T[0], T[1], T[2]);
    GetVehicleZAngle(vid, T[3]);
    SetVehicleVelocity(vid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
    SetVehicleHealth(vid,floatpower(1500.84,16));
    return 1;
}



Re: Speed boost car exploding. - suhrab_mujeeb - 14.12.2011

What do you mean by this?
pawn Код:
SetVehicleHealth(vid,floatpower(1500.84,16));



Re: Speed boost car exploding. - SnG.Scot_MisCuDI - 14.12.2011

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
What do you mean by this?
pawn Код:
SetVehicleHealth(vid,floatpower(1500.84,16));
Wow didnt even notice it. I took it out and it works fine. Idk what that was doing there


Re: Speed boost car exploding. - suhrab_mujeeb - 14.12.2011

You were setting the vehicle health to 2139095040.


Re: Speed boost car exploding. - SnG.Scot_MisCuDI - 14.12.2011

Quote:
Originally Posted by suhrab_mujeeb
Посмотреть сообщение
You were setting the vehicle health to 2139095040.
yeah when i went in game i did /dl and when someone would use it, there car health would be set to 1 $ (is what it showed me) then it set back to 10000 lol. But it fixed now. Thanks!