Help with "repair" command - 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: Help with "repair" command (
/showthread.php?tid=509427)
Help with "repair" command -
Rockyyy - 26.04.2014
hey I'd like that any one helps me with /repair [ID] Command.
Re: Help with "repair" command -
ReD_HunTeR - 26.04.2014
do you need this?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/repair", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You must be in vehicle to fix your car!");
new VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
GameTextForPlayer(playerid,"~g~Vehicle Repair!",3000,3);
SetVehicleHealth(VehicleID, 1000);
return 1;
}
return 0;
}
Re: Help with "repair" command -
Rockyyy - 26.04.2014
I don't want him to fix his own car I want it for other players
Re: Help with "repair" command -
ReD_HunTeR - 26.04.2014
you have sscanf plugin?
Re: Help with "repair" command -
iZN - 26.04.2014
pawn Код:
CMD:repair(playerid, params[])
{
new gid;
if(sscanf(params, "u", gid))
{
SendClientMessage(playerid, -1, "Correct usage: /repair <playerid/name>");
return true;
}
if(gid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "Invalid playerid!");
if(!IsPlayerInAnyVehicle(gid))
return SendClientMessage(playerid, -1, "The player is not in any vehicle!");
new VehicleID = GetPlayerVehicleID(gid);
RepairVehicle(VehicleID);
GameTextForPlayer(gid, "~g~Vehicle Repaired!",3000,3);
SetVehicleHealth(VehicleID, 1000.0);
return true;
}
Re: Help with "repair" command -
Rockyyy - 26.04.2014
Thx