07.08.2011, 04:50
(
Последний раз редактировалось Sledge; 07.08.2011 в 05:23.
)
Hi, here is my /getcar CMD. This spawns car IDs to the users location. The only problem is it only spawns up to car ID 2. We had 3 players online at the time we tested the command.
pawn Код:
CMD:getcar(playerid, params[]) {
if(playerVariables[playerid][pAdminLevel] >= 3)
{
new vehid,messageString[64],logString[64],Float:x, Float:y, Float:z, Float:vehx, Float:vehy, Float:vehz;
if(sscanf(params, "u", vehid))
{
SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/getcar [vehicleid]");
return 1;
}
if(vehid != INVALID_VEHICLE_ID)
{
GetPlayerPos(playerid, x, y, z);
GetVehiclePos(vehid, vehx, vehy, vehz);
SetVehiclePos(vehid, x, y+4, z+1);
SetVehicleVirtualWorld(vehid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehid, GetPlayerInterior(playerid));
format(messageString, sizeof(messageString), "You have teleported car ID {CD0000}%d{FFFFFF} to your location.", vehid);
SendClientMessage(playerid, COLOR_WHITE, messageString);
format(logString, sizeof(logString), "%s has teleported car ID %d (coords: %d, %d, %d)", playerVariables[playerid][pNormalName], vehid, vehx, vehy, vehz);
mysql_real_escape_string(logString, logString);
adminLog(logString);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle ID.");
}
}
return 1;
}