pawn Код:
COMMAND:givecar(playerid, params[])
{
if(APlayerData[playerid][PlayerLevel] >= 1)
SendAdminText(playerid, "/givecar", params);
new OldCardi[MAX_PLAYER_NAME] = 0;
new id, carid; new Float: x, Float: y, Float: z, Float: r, vehicle;
new engine,lights,alarm,doors,bonnet,boot,objective;
if(sscanf(params, "ui", id, carid)) return SendClientMessage(playerid, 0xFFFFFFF,"Hata! Komutun kullanymy: /givecar [Playerid] [Carid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFF,"Bцyle bir oyuncu bulunamady!");
if(carid < 400 || carid > 611) return SendClientMessage(playerid, 0xFFFFFFF, "Araз id leri 400 ile 611 arasynda olmalydyr.");
if(IsPlayerInAnyVehicle(id)) DestroyVehicle(GetPlayerVehicleID(id));
if(OldCardi[id] > 0)
{
DestroyVehicle(OldCardi[id]);
OldCardi[id] = 0;
}
GetPlayerPos(id, x, y, z);
GetPlayerFacingAngle(id, r);
vehicle = CreateVehicle(carid, x, y, z, r, 1, 1, 300);
PutPlayerInVehicle(id, vehicle, 0);
AVehicleData[vehicle][Fuel] = MaxFuel;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 1, 1, alarm, doors, bonnet, boot, objective);
OldCardi[id] = GetPlayerVehicleID(id);
return 1;
}