19.04.2011, 10:24
This is the modifed script,as on another topic "Vince" said that OnPlayerEnterVehicle is very different from OnPlayerStateChange.So this is the new script:
I'm waiting especially for help from Vince,as maybe he's good at Vehicle Scripts,and I wanna know(wich is probably the problem)if the float values of GetVehicleVelocity are correct.
Note:No errors when compiling.'
HELP!!!
pawn Код:
#include <a_samp>
#define DIALOG_INFERNALRACE 5
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid=GetPlayerVehicleID(playerid);
GetPlayerState(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleModel(vehicleid);
if(vehicleid == 431)
{
new Float:x, Float:y, Float:z;
GetVehicleVelocity(vehicleid,x,y,z);
if(GetVehicleVelocity(vehicleid,x,y,z) == x*1.5,y*1.5,z*1.5)
{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"Infernal Race","A bomb has been planted on your bus,\nand if you slow down below 50mph,\nyou will be blowed up","Accept","Accept");
}
}
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==5)
{
if(response==1)
{
new vehicleid=GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
if(GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z) == x*1.5,y*1.5,z*1.5)
{
SendClientMessage(playerid,RED,"A bomb has been planted on your bus,DON'T SLOW DOWN BELOW 50mph OR YOU'LL be blwoed up");
}
if(GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z) < x*0.5,y*0.5,z*0.5)
{
SetVehicleHealth(vehicleid,0);
SendClientMessage(playerid,RED,"BYE BYE,mission acomplished,bus blowed up");
}
}
if(response==1)
{
new vehicleid=GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z;
GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
if(GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z) == x*1.5,y*1.5,z*1.5)
{
SendClientMessage(playerid,RED,"A bomb has been planted on your bus,DON'T SLOW DOWN BELOW 50mph OR YOU'LL be blwoed up");
}
if(GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z) < x*0.5,y*0.5,z*0.5)
{
SetVehicleHealth(vehicleid,0);
SendClientMessage(playerid,RED,"BYE BYE,mission acomplished,bus blowed up");
}
}
}
Note:No errors when compiling.'
HELP!!!