Repairing someone's car not being in it (By Admin) -
TV94 - 04.01.2012
Can someone give me a script please which will repair someones car not being in it? Like i am outside and Mike is in the car, i type some command (ex: /arepair) and Mike's car is repaired full (not only the engine, but all car). Thank you.
Re: Repairing someone's car not being in it (By Admin) -
§с†¶e®РµРe - 04.01.2012
U want to repair the nearest vehicle??
Re: Repairing someone's car not being in it (By Admin) -
TV94 - 04.01.2012
Not the nearest but any car i want to repair being someone in it. Like if i am in LS and Mike is in LV and he is in a car, i type /arepair mike or /arepair 1 (his ID), and his car is repaired even if he is in other part of the map. If he is not in a car to write: Player is not in a car, and if ID 1 or Mike is not Online to write: Player is not connected, and if i am not [pAdmin] > 3 to write: You are not authorized to use this command.
Re: Repairing someone's car not being in it (By Admin) -
FTLOG - 04.01.2012
pawn Код:
CMD:arepair( playerid, params[] ) {
if( PlayerInfo[ playerid ][ pAdmin ] < 3 ) return SendClientMessage( playerid, 0xFFFFFFFF, "Not authorized!" );
new ID_2;
if( sscanf( params, "u", ID_2 )) return SendClientMessage( playerid, 0xFFFFFFFF, "Usage: /repair [ID/PartOfName]" );
if( !IsPlayerConnected( ID_2 ) || ID_2 == INVALID_PLAYER_ID ) return SendClientMessage( playerid, 0xFFFFFFFF, "Wrong ID!" );
if( !GetPlayerVehicleID( ID_2 ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "That player is not in a vehicle!" );
RepairVehicle( GetPlayerVehicleID( ID_2 ) );
SendClientMessage( playerid, 0xFFFFFFFF, "Vehicle repaired!" );
return true;
}
Re: Repairing someone's car not being in it (By Admin) -
Tamao_Serizawa - 04.01.2012
Its a command for admin like /repair [id]
Maybe some admin commands may help you
pawn Код:
if(strcmp(cmd, "/fixveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
SendClientMessage(playerid, COLOR_GREY, " You have fixed your vehicle !");
}
}
return 1;
}
Re: Repairing someone's car not being in it (By Admin) -
Konstantinos - 04.01.2012
Quote:
Originally Posted by Tamao_Serizawa
Its a command for admin like /repair [id]
Maybe some admin commands may help you
pawn Код:
if(strcmp(cmd, "/fixveh", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); return 1; } if(IsPlayerInAnyVehicle(playerid)) { SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0); SendClientMessage(playerid, COLOR_GREY, " You have fixed your vehicle !"); } } return 1; }
|
He want to /arepair [ID/Player Name], not to repair his own car. User above you is correct.
Except this part
Just delete it, because we are using params on the command
Re: Repairing someone's car not being in it (By Admin) -
FTLOG - 04.01.2012
Quote:
Originally Posted by Dwane
He want to /arepair [ID/Player Name], not to repair his own car. User above you is correct.
Except this part
Just delete it, because we are using params on the command
|
Damn it, sorry... Fixed.
Re: Repairing someone's car not being in it (By Admin) -
TV94 - 04.01.2012
FTLOG i have this errors and warnings:
D:\Power 0.3D\gamemodes\eGamer.pwn(36322) : error 017: undefined symbol "arepair"
D:\Power 0.3D\gamemodes\eGamer.pwn(36327) : error 017: undefined symbol "params"
D:\Power 0.3D\gamemodes\eGamer.pwn(36339) : warning 225: unreachable code
D:\Power 0.3D\gamemodes\eGamer.pwn(36322) : warning 203: symbol is never used: "CMD"
Re: Repairing someone's car not being in it (By Admin) -
Konstantinos - 04.01.2012
It seems, you are not using ZCMD, but what?
- Strcmp
- Dcmd
Re: Repairing someone's car not being in it (By Admin) -
TV94 - 04.01.2012
The majority of the commands are Strcmp but i have some of Dcmd type.