Car Units
#7

Guys, this is absolutely possible, he just wants to show the name on enter, not change the number plate.
Create a big array like this:

new CarNames[MAX_VEHICLES][24];

Ok, this eats a lot of ram, ~200kb, but this should be no big problem.
Then add a command like this (untested):

pawn Код:
//Usage: /setplate <new_name>
if(strcmp("/setplate", cmdtext, true, 9) == 0)
{
    if(!IsPlayerInAnyVehicle(playerid)) return 1;
    strmid(CarNames[GetPlayerVehicleID(playerid)], cmdtext, 10, strlen(cmdtext));
    new text[64];    
    format(text, 64, "You changed the vehicle's name to %s.", CarNames[GetPlayerVehicleID(playerid)]);
    SendClientMessage(playerid, 0xAAAA33AA, text);
    return 1;
}

//To show it on vehicle enter add this to your OnPlayerEnterVehicle, as you already mentioned
if(strlen(CarNames[vehicleid])
{
    new text[64];    
    format(text, 64, "You entered the vehicle: %s.", CarNames[vehicleid]);
    SendClientMessage(playerid, 0xAAAA33AA, text);
}
//Change all strings to whatever you want
Saving that all would be harder, because most ini includes do not support 2000 entries in a file. You would need a car saver system that creates a file for each car and spawns them from that file, so that there are no problems with changing vehicle ids.
Reply


Messages In This Thread
Car Units - by Callit - 18.09.2010, 18:36
Re: Car Units - by FireCat - 18.09.2010, 19:01
Re: Car Units - by Mike_Peterson - 18.09.2010, 21:07
Re: Car Units - by Callit - 19.09.2010, 02:14
Re: Car Units - by Claude - 19.09.2010, 08:41
Re: Car Units - by Leeroy. - 19.09.2010, 08:45
Re: Car Units - by Mauzen - 19.09.2010, 09:07
Re: Car Units - by playbox12 - 19.09.2010, 09:30
Re: Car Units - by Callit - 21.09.2010, 10:58
Re: Car Units - by Callit - 23.09.2010, 13:28

Forum Jump:


Users browsing this thread: 1 Guest(s)