25.09.2012, 10:33
pawn Код:
CMD:spawnveh(playerid, params[])
{
new id, Float:pos[4], col[2];
new inputtext[40];
new modelid = strval(inputtext);
if(sscanf(params, "ii", modelid, col[0], col[1])) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [vehicleid] [color1] [color2]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"You are not in any vehicle to whom you want to change");
new vehicleid = GetPlayerVehicleID(playerid);
DestroyVehicle(vehicleid);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
vipcar = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], col[0], col[1], 1200);
PutPlayerInVehicle(playerid,vipcar,1);
//format(string, sizeof(string), "AdmWarn: %s has spawned a vehicle model %d.", RPN(playerid), id);
//SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}