05.06.2014, 08:18
[FilterScript] Vehicle Spawn /V Carname|Carid Color1 Color2
05.06.2014, 08:53
Very nice.
05.06.2014, 12:39
It works fine, but I do have a question. How can I display the name of the car that I just spawned?
05.06.2014, 12:46
Quote:
It works fine, but I do have a question. How can I display the name of the car that I just spawned?
|
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
new str[32];
if (newstate == 2 || newstate == 3)
{
format(str, sizeof(str), "~g~~h~%s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
GameTextForPlayer(playerid, str, 1500, 1);
}
}
return 1;
}
05.06.2014, 23:08
OP, you could try the custom vehicle specifier built-in the sscanf include as an example: it'll shorten your code a lot. Think something like this:
See the code of the vehicle specifier in sscanf.inc to see how it works and you'll soon be on... well, not necessarily the right track, but most certainly an easier one.
pawn Код:
new pVeh[MAX_PLAYERS];
CMD:v(playerid, params[]) {
new modelid, color[2], fPos[4];
if(sscanf(params, "k<vehicle>D(1)D(1)", modelid, color[0], color[1]))
return SendClientMessage(playerid, -1, "USAGE: /v <vehicle id/name> <optional: color1> <optional: color2>");
if(pVeh[playerid]) DestroyVehicle(pVeh[playerid]);
GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
GetPlayerFacingAngle(playerid, fPos[3]);
pVeh[playerid] = CreateVehicle(playerid, fPos[0], fPos[1], fPos[2], fPos[3], color[0], color[1], 0);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
return true;
}
08.11.2014, 20:33
i placed the file in filterscripts and added cs in the server.cfg but when i enter the server it doesnt work , any help ?
11.12.2014, 13:42
it's Bugged. Somethimes when i wanna spawn car, it disappear.
12.05.2018, 20:49
Nice job.
« Next Oldest | Next Newest »
Users browsing this thread: 4 Guest(s)