How do i do this:
#1

If i already have something like this under OnPlayerCommand:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Teleport", true) == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
return 1;
}
return 0;
}


How would I add this onto it:
public OnPlayerCommandText(...)
{
//This will start your engine!
if(strcmp(cmd, "/startengine",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
// ||||||
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,al arm,doors,bonnet,boot,objective);
//VEHICLE_PARAMS_ON is used to start the engine,it purely replace the engine thing!
}
return 1;
}
if(strcmp(cmd, "/stopengine",true) == 0) {
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID) {
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
// ||||||
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,a larm,doors,bonnet,boot,objective);
//Here the VEHICLE_PARAMS_OFF will turn off your engine.
}
return 1;
}


Every time i try to add something underneath, it gives me a error. Please help?
Reply


Messages In This Thread
How do i do this: - by kickflipdude - 29.03.2011, 19:54
Re: How do i do this: - by antonio112 - 29.03.2011, 20:10
Re: How do i do this: - by kickflipdude - 29.03.2011, 20:16
Re: How do i do this: - by kickflipdude - 29.03.2011, 20:20
Re: How do i do this: - by Serbish - 29.03.2011, 20:23
Re: How do i do this: - by kickflipdude - 29.03.2011, 20:55
Re: How do i do this: - by SchurmanCQC - 29.03.2011, 20:59
Re: How do i do this: - by kickflipdude - 29.03.2011, 21:30
Re: How do i do this: - by antonio112 - 29.03.2011, 21:32
Re: How do i do this: - by antonio112 - 29.03.2011, 23:53

Forum Jump:


Users browsing this thread: 1 Guest(s)