23.01.2012, 17:57
Alright, my issue is.. when I type /spawnfvehicle (creates a faction vehicles) then i set my faction to the same as the vehicle and then I set my rank to 6, then I type /fsave and It returns Unknown command Although if I restart the server and type /fsave (after it's loaded the vehicles from mysql).
pawn Code:
CMD:fsave(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(FRank[playerid] < 6) return SendClientMessage(playerid, COLOUR_GREY, "You are not a high enough rank.");
new vehicleid = GetPlayerVehicleID(playerid);
new VSQLID = MySQL_GetValue(vehicleid, "id", "factionvehicles");
Faction[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "faction", "accounts");
VehicleFaction[VSQLID] = MySQL_GetValue(vehicleid, "faction", "factionvehicles");
if(Faction[playerid] != VehicleFaction[VSQLID] || Faction[playerid] != VehicleFaction[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "You are not in this faction.");
new Float:x, Float:y, Float:z, Float:a;
if(IsPlayerInAnyVehicle(playerid) && VehicleFaction[vehicleid] >= 1 || IsPlayerInAnyVehicle(playerid) != VehicleFaction[VSQLID])
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, Float:a);
VehicleX[VSQLID] = x;
MySQL_SetFloat(VSQLID, "VehicleX", x, "factionvehicles");
VehicleY[VSQLID] = y;
MySQL_SetFloat(VSQLID, "VehicleY", y, "factionvehicles");
VehicleZ[VSQLID] = z;
MySQL_SetFloat(VSQLID, "VehicleZ", z, "factionvehicles");
VehicleAngle[VSQLID] = a;
MySQL_SetFloat(VSQLID, "VehicleAngle", a, "factionvehicles");
SendClientMessage(playerid, COLOUR_ORANGE, "Faction Vehicle Saved, It will now spawn here in the future.");
return 1;
}