30.08.2011, 19:32
i want to add /lock and /park .
Don't worry about buying the lock, i want every player to have it automatically. But, here's the car stuff i use.
/car lock and /car park?
Thanks. Anyone who helps gets a reppo
Don't worry about buying the lock, i want every player to have it automatically. But, here's the car stuff i use.
pawn Код:
if(strcmp(cmd, "/car", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[32];
x_nr = strtok(cmdtext, idx);
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,hood,trunk,objective;
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car [name]");
SendClientMessage(playerid, COLOR_GRAD1, "Available names: Engine, Lights, Hood, Trunk");
return 1;
}
if(strcmp(x_nr,"engine",true) == 0)
{
if(GetPVarInt(playerid, "Engine") == 0)
{
GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,hood,trunk,objective);
SetPVarInt(playerid, "Engine", 1);
}
else if(GetPVarInt(playerid, "Engine") == 1)
{
GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,hood,trunk,objective);
SetPVarInt(playerid, "Engine", 0);
}
return 1;
}
if(strcmp(x_nr,"lights",true) == 0)
{
if(GetPVarInt(playerid, "Lights") == 0)
{
GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,hood,trunk,objective);
SetPVarInt(playerid, "Lights", 1);
}
else if(GetPVarInt(playerid, "Lights") == 1)
{
GetPlayerVehicleID(playerid);
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,hood,trunk,objective);
SetPVarInt(playerid, "Lights", 0);
}
return 1;
}
if(strcmp(x_nr,"hood",true) == 0)
{
if(GetPVarInt(playerid, "Hood") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,trunk,objective);
SetPVarInt(playerid, "Hood", 1);
}
else if(GetPVarInt(playerid, "Hood") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,trunk,objective);
SetPVarInt(playerid, "Hood", 0);
}
return 1;
}
if(strcmp(x_nr,"trunk",true) == 0)
{
if(GetPVarInt(playerid, "Trunk") == 0)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,VEHICLE_PARAMS_ON,objective);
SetPVarInt(playerid, "Trunk", 1);
}
else if(GetPVarInt(playerid, "Trunk") == 1)
{
GetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,trunk,objective);
SetVehicleParamsEx(veh,engine,lights,alarm,doors,hood,VEHICLE_PARAMS_OFF,objective);
SetPVarInt(playerid, "Trunk", 0);
}
Thanks. Anyone who helps gets a reppo