#1

How can i make a /nos command?
Reply
#2

pawn Код:
CMD:nos(playerid, params[])
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        AddVehicleComponent(vehicle, 1010);
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You must be in a vehicle to use this command.");
    }
    return 1;
}
Untested.
Reply
#3

You can make it shorter to save diskspace:

pawn Код:
CMD:nos(playerid, params[])
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
    else return SendClientMessage(playerid, 0xFFFFFFFF, "You must be in a vehicle to use this command.");
}
Please note that you need the include 'zcmd' for this
Reply
#4

pawn Код:
CMD:nos(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid); return SendClientMessage(playerid,red,"You must be in a vehicle to add nos to it!");

    new vehicle = GetPlayerVehicleID(playerid);
    AddVehicleComponent(vehicle, 1010);
    return 1;
}
Not tested but should work ;P
Reply
#5

Thanks!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)