14.05.2012, 09:38
Your indentation style kills me, anyways I've taken the /engine command from my script and changed it to fit on yours, also use this stock instead of GetPlayerName on every single command and place RPNU(playerid) instead of pname
pawn Код:
stock RPNU(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
pawn Код:
CMD:engine(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid, string[128];
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine)
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s attempts to turn on the engine, and succeeds", RPNU(playerid));
ProxDetector(30.0, playerid, str, COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN,COLOR_LIGHTGREEN);
}
else
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
format(string, sizeof(string), "* %s attempts to turn off the engine, and succeeds", RPNU(playerid));
ProxDetector(30.0, playerid, str, COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK,COLOR_PINK);
}
return 1;
}