A cmd please
#1

Guys, who can make a /repair cmd for me please its for a rp server,
I want that that cmd repairs the whole engine please.

Thank you.
Reply
#2

First of all,

ZCMD:
[Include] zcmd 0.3.1 | Fast & Simple Command Processor (updated 30/10/2009)

Check your "PAWNO > includes" Directory, and Look for "zcmd.inc",

If you don't have "zcmd.inc",

(NOTE: Make sure you open the same PAWNO that contains all your stuff)

Download it here,

[Include] zcmd 0.3.1 | Fast & Simple Command Processor (updated 30/10/2009)
SolidFiles for ZCMD 0.3.1

Installation:
  1. Copy the whole include codes in Notepad, Wordpad, etc..
  2. Save it as "include's name.inc", and Save it in "PAWNO > include".
  3. Open your Gamemode Script using PAWNO Compiler.
  4. Add "#include <include's name>" at the Top of your Gamemode Script.
  5. Compile it, Save it, and Finish.
and/or
  1. Download the Include File, Copy it.
  2. Paste it in "PAWNO > include".
  3. Open your Gamemode Script using PAWNO Compiler.
  4. Add "#include <include's name>" at the Top of your Gamemode Script.
  5. Compile it, Save it, and Finish.
Try This:
pawn Код:
CMD:repair(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You are not in any Car / Vehicle.");
    SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
    format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've repaired your Car / Vehicle.");
    SendClientMessage(playerid, -1, string);
    GameTextForPlayer(playerid, "~g~Car / Vehicle~r~ Repaired", 2000, 1);
    return 1;
}
pawn Код:
CMD:repair(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You are not in any Car / Vehicle.");
    RepairVehicle(GetPlayerVehicleID(playerid));
    format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've repaired your Car / Vehicle.");
    SendClientMessage(playerid, -1, string);
    GameTextForPlayer(playerid, "~g~Car / Vehicle~r~ Repaired", 2000, 1);
    return 1;
}
or

pawn Код:
CMD:rconrepair(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You must be an RCON Admin to use this Command.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You are not in any Car / Vehicle.");
    SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);
    format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've repaired your Car / Vehicle.");
    SendClientMessage(playerid, -1, string);
    GameTextForPlayer(playerid, "~g~Car / Vehicle~r~ Repaired", 2000, 1);
    return 1;
}
pawn Код:
CMD:rconrepair(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You must be an RCON Admin to use this Command.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}<!> {EEEEEE}You are not in any Car / Vehicle.");
    RepairVehicle(GetPlayerVehicleID(playerid));
    format(string, sizeof(string), "{FF0000}<!> {EEEEEE}You've repaired your Car / Vehicle.");
    SendClientMessage(playerid, -1, string);
    GameTextForPlayer(playerid, "~g~Car / Vehicle~r~ Repaired", 2000, 1);
    return 1;
}
Reply
#3

Much simpler way then the above post, here you go.

Код:
CMD:fixme(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle dumbass!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, COLOR_ORANGE, "It was a close call but, we got her fixed up!");
    return 1;
}
You will need to download the zcmd include and add it to your pawn include folder. In addition you will need to add;

Код:
#include <zcmd>
in your code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)