18.08.2012, 15:45
anywone have the code for /nos and /repair pleas?
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!PlayerInfo[playerid][pLoggedIn]) return 0;
dcmd_fix(playerid, params[])
{
new id;
if (sscanf(params, "u", id)) { id = playerid; }
if (id == INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_RED, "* /repair: Invalid player"); }
else
{
new veh = GetPlayerVehicleID(id);
if (veh)
{
RepairVehicle(veh);
if (playerid != id) { SendClientMessage(playerid, COLOR_GREEN, "Repaired vehicle"); }
SendClientMessage(id, COLOR_GREEN, "Your vehicle was repaired");
}
else { SendClientMessage(playerid, COLOR_RED, "That player is currently not in a vehicle"); }
}
return 1;
}
dcmd_nos(playerid, params[])
{
new id;
if (sscanf(params, "u", id)) { id = playerid; }
if (id == INVALID_PLAYER_ID) { SendClientMessage(playerid, COLOR_RED, "* /nos: Invalid player"); }
else
{
new veh = GetPlayerVehicleID(id);
if (veh)
{
AddVehicleComponent(veh, 1010);
if (playerid != id) { SendClientMessage(playerid, COLOR_GREEN, "Added nos to vehicle"); }
SendClientMessage(id, COLOR_GREEN, "Added nos to vehicle");
}
else { SendClientMessage(playerid, COLOR_RED, "That player is currently not in a vehicle"); }
}
return 1;
}
BTW, You must learn scripting yourself, instead of making 3-4 command request thread everyday.
pawn Код:
pawn Код:
pawn Код:
|