SA-MP Forums Archive
CMD to show car ID - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD to show car ID (/showthread.php?tid=348934)



CMD to show car ID - lewismichaelbbc - 07.06.2012

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


Re: CMD to show car ID - MadeMan - 07.06.2012

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;
}



Re: CMD to show car ID - CaHbKo - 07.06.2012

Also try '/dl'


Re: CMD to show car ID - Faisal_khan - 07.06.2012

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


Re: CMD to show car ID - liquor - 07.06.2012

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...


Re: CMD to show car ID - MadeMan - 07.06.2012

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.


Re: CMD to show car ID - liquor - 07.06.2012

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.


Re: CMD to show car ID - MadeMan - 07.06.2012

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.