Код:
CMD:nrg(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!");
{
if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]);
CarId[playerid] = CreateVehicle(522, x, y, z, angle, -1, -1, 6000);
PutPlayerInVehicle(playerid, CarId[playerid], 0);
SendClientMessage(playerid, COLOR_LIME, "You spawn an nrg!");
}
return 1;
}
CMD:car(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
if(PlayerAcc[playerid][Log] == 0) return SendClientMessage(playerid, COLOR_RED, "Error: You are not logged in!");
{
if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]);
CarId[playerid] = CreateVehicle(411, x, y, z, angle, -1, -1, 6000);
PutPlayerInVehicle(playerid, CarId[playerid], 0);
SendClientMessage(playerid, COLOR_LIME, "You spawn an infernus!");
}
return 1;
}
Код:
CMD:v(playerid, params[])
{
new string[128], vID[32], vid, Float:x, Float:y, Float:z, Float:ang;
if(sscanf(params, "s[32]", vID)) return SendClientMessage(playerid, COLOR_RED, "Syntax: /v (carname)");
if(isnumeric(vID)) vid = strval(vID);
else vid = GetVehicleModelIDFromName(vID);
if (vid < 400 || vid > 611) return SendClientMessage(playerid, COLOR_RED, "Vehicle ID Maxium (Left): 400 - Maxium (Right): 611");
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,ang);
if(CarId[playerid] != INVALID_VEHICLE_ID) DestroyVehicle(CarId[playerid]);
CarId[playerid] = CreateVehicle(vid, x, y, z, ang, -1, -1, 6000);
LinkVehicleToInterior(CarId[playerid], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(CarId[playerid], GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, CarId[playerid], 0);
format(string, sizeof(string), "You've spawned vehicle id %i - %s", vid, VehicleName[vid - 400]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
and some dialog bug
when im in a vehicle and i type a command that display a message dialog, when i click on ok or press esc, my vehicle destroy