Respawn car + Reason
#1

Hi, I found your order respwan car but I would also
SCMTA: "Administrator vehicle respawn [ID] [Reason]"
I do not know how to do it, I knew someone would do that?
Код:
CMD:respawncar( playerid, params[ ] )
{
if(alevel[playerid] < 1) return SCM(playerid, BIELA, "[ ! ] Nemбљ dostatočnй Admin Prбva !");

    static
        vehID
    ;

    if ( sscanf( params, "i",  vehID ) )
        return SendClientMessage( playerid, -1, "Pouћi: /respawncar < carID >" );

    if ( vehID == INVALID_VEHICLE_ID )
        return SendClientMessage( playerid, -1, "ERROR: Bad CarID ." );

    SetVehicleToRespawn( vehID );

    SendClientMessage( playerid, -1, "Vehicle has been respawned succesfully." );

    return 1;
}
Reply
#2

I am on my phone right now therefore I will just explain to you and write you the code when I am back. However, you are doing it well but instead of checking for VehID check for a reason too by checking for a string 's' then save it in the variable and display it in a formatted message as usual.
Reply
#3

pawn Код:
CMD:respawncar(playerid, params[])
{
    if(alevel[playerid] < 1) return SCM(playerid, BIELA, "[ ! ] Nemбš dostatoc(nй Admin Prбva !");
   
    static
        vehID
    ;
    new reason[128];

    if(sscanf( params, "iS", vehID, reason)) return SendClientMessage( playerid, -1, "Použi: /respawncar < carID > < reason >" );
    if (vehID == INVALID_VEHICLE_ID) return SendClientMessage( playerid, -1, "ERROR: Bad CarID ." );

    SetVehicleToRespawn( vehID );

    format(string, sizeof string, "Vehicle has been respawned successfully. Reason %s.", reason);
    SendClientMessage(playerid, -1, string);

    return 1;
}
Reply
#4

Quote:
Originally Posted by [..MonTaNa..]
Посмотреть сообщение
pawn Код:
CMD:respawncar(playerid, params[])
{
    if(alevel[playerid] < 1) return SCM(playerid, BIELA, "[ ! ] Nemбљ dostatoc(nй Admin Prбva !");
   
    static
        vehID
    ;
    new reason[128];

    if(sscanf( params, "iS", vehID, reason)) return SendClientMessage( playerid, -1, "Pouћi: /respawncar < carID > < reason >" );
    if (vehID == INVALID_VEHICLE_ID) return SendClientMessage( playerid, -1, "ERROR: Bad CarID ." );

    SetVehicleToRespawn( vehID );

    format(string, sizeof string, "Vehicle has been respawned successfully. Reason %s.", reason);
    SendClientMessage(playerid, -1, string);

    return 1;
}
The reason I know but I want to Administrator repawn vehicle [vehicle id] [reason]
Vehicle id already I do not know
Reply
#5

Eum.. Isn't that what you're looking for? If not, please be more specific.
Reply
#6

I need SCMT: Administrator% s spawn vehicle [vehicle id] [reason]
The reason it is still a vehicle to respawn id make it look like this: Admin %s respawn vehicle [vehicle id. for example 652] [reason]
Reply
#7

pawn Код:
CMD:respawncar(playerid, params[])
{
    if(alevel[playerid] < 1) return SCM(playerid, BIELA, "[ ! ] Nemбљ dostatoc(nй Admin Prбva !");

    static
        vehID
    ;
    new reason[128];

    if(sscanf( params, "iS", vehID, reason)) return SendClientMessage( playerid, -1, "Pouћi: /respawncar < carID > < reason >" );
    if (vehID == INVALID_VEHICLE_ID) return SendClientMessage( playerid, -1, "ERROR: Bad CarID ." );

    SetVehicleToRespawn( vehID );

    new string[128];
    format(string, sizeof string, "Admin %s (%d) has respawned vehicle ID %d successfully. Reason %s.", PlayerName(pID), pID, vehid, reason);
    SendClientMessage(playerid, -1, string);

    return 1;
}
Hope this helps
Reply
#8

Works very nice thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)