Problem with my /engine command
#2

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;
}
Reply


Messages In This Thread
Problem with my /engine command - by Verbal - 14.05.2012, 09:30
Re: Problem with my /engine command - by iRage - 14.05.2012, 09:38
Re: Problem with my /engine command - by Verbal - 14.05.2012, 09:48
Re: Problem with my /engine command - by iRage - 14.05.2012, 09:55
Re: Problem with my /engine command - by Verbal - 14.05.2012, 10:36
Re: Problem with my /engine command - by imnoob - 14.05.2012, 12:14
Re: Problem with my /engine command - by Jack_Leslie - 14.05.2012, 12:30
Re: Problem with my /engine command - by Riddick94 - 14.05.2012, 12:30
Re: Problem with my /engine command - by Verbal - 14.05.2012, 14:18
Re: Problem with my /engine command - by iRage - 14.05.2012, 14:53

Forum Jump:


Users browsing this thread: 1 Guest(s)