CMD to show car ID
#1

How can i make a CMD that will show the car model ID that I am sat in?

Like /carmodel then in sendclientmessage it shows the model ID

Thanks
Reply
#2

Using zcmd

pawn Код:
CMD:carmodel(playerid, params[])
{
    new msg[128];
    new vehicleid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(vehicleid);
    format(msg, sizeof(msg), "Vehicle Model: %d", modelid);
    SendClientMessage(playerid, -1, msg);
    return 1;
}
Reply
#3

Also try '/dl'
Reply
#4

pawn Код:
if (strcmp("/carmodel", cmdtext, true, 8) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid, string[64];
            format(string,sizeof(string),"Vehicle Model: %d",GetVehicleModel(vehicleid));
            SendClientMessage(playerid,0xFFFFFFAA,string);
        }
        else
        {
            return 1;
        }
        return 1;
    }
EDIT: LATE
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Using zcmd

pawn Код:
CMD:carmodel(playerid, params[])
{
    new msg[128];
    new vehicleid = GetPlayerVehicleID(playerid);
    new modelid = GetVehicleModel(vehicleid);
    format(msg, sizeof(msg), "Vehicle Model: %d", modelid);
    SendClientMessage(playerid, -1, msg);
    return 1;
}
Why 128 cells for a message like that? 110 of those 128 cells will NEVER be used...
Reply
#6

Quote:
Originally Posted by liquor
Посмотреть сообщение
Why 128 cells for a message like that? 110 of those 128 cells will NEVER be used...
128 is a standard size I use for client messages, so I don't have to worry about it when I change the message to something longer. You can use smaller values if you like counting characters.
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
128 is a standard size I use for client messages, so I don't have to worry about it when I change the message to something longer. You can use smaller values if you like counting characters.
I know that, but there's no point in changing a command like this, unless you want to remove It completely.
Messages this short are worth to count, to not waste server resources on empty cells.
Reply
#8

Quote:
Originally Posted by liquor
Посмотреть сообщение
I know that, but there's no point in changing a command like this, unless you want to remove It completely.
For example, I could want to add vehicle ID and health to the message.

Quote:
Originally Posted by liquor
Посмотреть сообщение
Messages this short are worth to count, to not waste server resources on empty cells.
Considering the fact that computers have gigabytes of memory, I don't think wasting some 400 bytes is so much of a problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)