A cmd please - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A cmd please (
/showthread.php?tid=473489)
A cmd please -
saffierr - 03.11.2013
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.
Re: A cmd please -
SAMProductions - 03.11.2013
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:
- Copy the whole include codes in Notepad, Wordpad, etc..
- Save it as "include's name.inc", and Save it in "PAWNO > include".
- Open your Gamemode Script using PAWNO Compiler.
- Add "#include <include's name>" at the Top of your Gamemode Script.
- Compile it, Save it, and Finish.
and/or
- Download the Include File, Copy it.
- Paste it in "PAWNO > include".
- Open your Gamemode Script using PAWNO Compiler.
- Add "#include <include's name>" at the Top of your Gamemode Script.
- 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;
}
Re: A cmd please -
0Z3ro0 - 03.11.2013
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;
in your code.