Repairing someone's car not being in it (By Admin)
#1

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.
Reply
#2

U want to repair the nearest vehicle??
Reply
#3

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.
Reply
#4

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;
}
Reply
#5

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;
    }
Reply
#6

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
pawn Код:
#pragma unused params
Just delete it, because we are using params on the command
Reply
#7

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
pawn Код:
#pragma unused params
Just delete it, because we are using params on the command
Damn it, sorry... Fixed.
Reply
#8

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"
Reply
#9

It seems, you are not using ZCMD, but what?
- Strcmp
- Dcmd
Reply
#10

The majority of the commands are Strcmp but i have some of Dcmd type.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)