10.03.2015, 02:48
pawn Код:
COMMAND:v(playerid, params[]) return cmd_vehicle(playerid, params);
COMMAND:vehicle(playerid, params[])
{
new x_vehicle[129], tmp, str[129],string[129];
if(JustVehicled[playerid] == 1) return SendErrorMessage(playerid, "You must wait atleast 3 seconds between each operation.");
JustVehicled[playerid] = 1;
SetTimerEx("VehicleReset", 2200, false, "i", playerid);
if(sscanf(params, "s[129]",x_vehicle))
{
SendClientMessage(playerid, COLOR_SERVER, "_____________________________________________");
SendUsageMessage(playerid, "/v(ehicle) [Usage]");
SendClientMessage(playerid, COLOR_GRAD1, "[ACTIONS]: buy, get");
SendClientMessage(playerid, COLOR_GRAD2, "[ACTIONS]: scrap {FF6347} (WARNING: This deletes your vehicle permanently.)");
return 1;
}
if(strcmp(x_vehicle, "get", true) == 0)
{
if(sscanf(params, "i",tmp)) return SendUsageMessage(playerid, "/v get [1-5]");
if(tmp == 1)
{
SendInfoMessage(playerid, "Debug 1x");
if(IsVehicleSpawned(PlayerInfo[playerid][pCarKey])) return SendErrorMessage(playerid, "You already have a vehicle that is spawned.");
if(strcmp(PlayerVehicle[playerid][pVeh1], "None", true))
{
SendInfoMessage(playerid, "Debug 2x");
format(str, sizeof(str), "PARA/Vehicles/%s.cfg",PlayerVehicle[playerid][pVeh1]);
if(dini_Exists(str))
{
SendInfoMessage(playerid, "Debug x3");
LoadVehicles(playerid, PlayerVehicle[playerid][pVeh1]);
SendClientMessage(playerid, COLOR_GREEN, "Vehicle is on it's parking place:");
format(string, sizeof(string), "%s, Alarm[%d], Lock[%d], Immobilizer[%d], GPS[%d], Insurances[%d], Times destroyed[%d], Insurance price[%d]", VehicleNames[GetVehicleModel(PlayerInfo[playerid][pCarKey])-400],
VehicleInfo[PlayerInfo[playerid][pCarKey]][vAlarm], VehicleInfo[PlayerInfo[playerid][pCarKey]][vLockBuyed], VehicleInfo[PlayerInfo[playerid][pCarKey]][vImmob], VehicleInfo[PlayerInfo[playerid][pCarKey]][vGPS], VehicleInfo[PlayerInfo[playerid][pCarKey]][vInsurances], VehicleInfo[PlayerInfo[playerid][pCarKey]][vDestroys], InsurancePrices[GetVehicleModel(PlayerInfo[playerid][pCarKey])-400] * VehicleInfo[PlayerInfo[playerid][pCarKey]][vMaxInsurances]);
SendClientMessage(playerid, COLOR_WHITE, string);
if(VehicleInfo[PlayerInfo[playerid][pCarKey]][vModel] == 481) { EngineStatus[PlayerInfo[playerid][pCarKey]] = 1; } else { EngineStatus[PlayerInfo[playerid][pCarKey]] = 0; }
SetPlayerCheckpoint(playerid, VehicleInfo[PlayerInfo[playerid][pCarKey]][vX], VehicleInfo[PlayerInfo[playerid][pCarKey]][vY], VehicleInfo[PlayerInfo[playerid][pCarKey]][vZ], 5.0); }
VCP[playerid] = 1;
ActiveCP[playerid] = 1;
}
else SendErrorMessage(playerid, "Vehicle Slot [1] is bugged for you, contact a developer.");
return 1;
}
else
{
SendErrorMessage(playerid, "There is no vehicle in that slot.");
return 1;
}
}
//
return 1;
}
The spawning of the vehicle and such isn't being reached, and I'm honestly tired and lost right now.