27.10.2013, 22:10
Alright, I did alot of mistake there due to I was in a hurry :P
Full Fix Code
Full Fix Code
pawn Код:
CMD:customvehicle(playerid, params[])
{
new playerb, string[128], modelid, slot, Positions[3];
if(sscanf(params, "udd", playerb, slot, modelid))
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /customvehicle [playerid] [1-3] [modelid]");
GetPlayerPos(playerb, Positions[0], Positions[1], Positions[2]);
if(!IsPlayerLoggedIn(playerid))
return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(400 <= modelid <= 611)
return SendClientMessage(playerid, COLOR_GREY, "Vehicles are between 400 and 611.");
if(PlayerInfo[playerid][pAdmin] < 3)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
switch(slot)
{
case 1:
{
PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);
GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);
format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 1) %s.", NORPN(playerid), NORPN(playerb)),
SendAdminMessage(COLOR_DARKRED, 1, string);
}
case 2:
{
PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);
GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);
format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 2) %s.", NORPN(playerid), NORPN(playerb)),
SendAdminMessage(COLOR_DARKRED, 1, string);
}
case 3:
{
PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);
GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);
format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 3) %s.", NORPN(playerid), NORPN(playerb)),
SendAdminMessage(COLOR_DARKRED, 1, string);
}
}
return true;
}