14.12.2011, 02:38
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;
}