29.03.2011, 19:54
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?
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?