Please help me with this.
#1

Hmm,my question is what values I am supossed to enter in stead of FloatXYZ:

GetVehicleVelocity(vehicleid,&FloatX,&FloatY,&Floa tZ);

And how to do the if statement:

if(GetVehicleVelocity == 60)
{
SendClientMessage(playerid,BLUE,"Bla bla bla...");
}
I suposse the if statement it's correct but not GetVehicleVelocity
Reply
#2

OK,so I'll give more details,this is in my gamemode:

#define DIALOG_INFERNALRACE 5

public OnPlayerEnterVehicle(playerid,vehicleid, ispassenger)
{
GetVehicleModel(vehicleid);
if(vehicleid == 431)
{
ShowPlayerDialog(playerid,5,DIALOG_STYLE_MSGBOX,"I nfernal 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==0)
{
new vehicleid=GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid,100,100,50);
if(GetVehicleVelocity == 60)
{
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 < 50)
{
SetVehicleHealth(vehicleid,0);
SendClientMessage(playerid,RED,"BYE BYE,mission acomplished,bus blowed up");
}
}
if(response==1)
{
new vehicleid=GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid,100,100,50);
if(GetVehicleVelocity == 60)
{
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 < 50)
{
SetVehicleHealth(vehicleid,0);
SendClientMessage(playerid,RED,"BYE BYE,mission acomplished,bus blowed up");
}
}
}

So what should I do as the errors are the following:

D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 62) : error 035: argument type mismatch (argument 2)
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 63) : error 076: syntax error in the expression, or invalid function call
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 67) : error 076: syntax error in the expression, or invalid function call
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 76) : error 035: argument type mismatch (argument 2)
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 77) : error 076: syntax error in the expression, or invalid function call
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(4 81) : error 076: syntax error in the expression, or invalid function call

The errors are in GetVehicleVelocity aand if statements.What should I do(and btw I still need help on vehicle topic)??
Reply
#3

You need a GetPlayerSpeed function .. GetVehicleVelocity is meant to retrieve the velocity of a vehicle, not the speed. Yes there is a difference between those two.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)