Hey guys i have a dynamic faction system that will spawn me at the coords i putted on structure from DB
this is the spawn function where should read if i am or not a faction members but it spawn's me anywhere else on the map
any idea why?
this is the spawn function where should read if i am or not a faction members but it spawn's me anywhere else on the map
HTML Code:
function FactionSpawn(playerid)
{
if(PlayerInfo[playerid][pMember] <= 0)
{
InHQ[playerid] = -1;
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
new SRandom = random(3);
SetPlayerPos(playerid, RandomCivSpawns[SRandom][0], RandomCivSpawns[SRandom][1], RandomCivSpawns[SRandom][2]);
SetPlayerFacingAngle(playerid, RandomCivSpawns[SRandom][3]);
}
if(PlayerInfo[playerid][pMember] > 0)
{
new fid = PlayerInfo[playerid][pMember];
SetPlayerInterior(playerid, DynamicFactions[fid][fInterior]);
SetPlayerVirtualWorld(playerid, DynamicFactions[fid][fVirtual]);
SetPlayerPos(playerid, DynamicFactions[fid][fcX], DynamicFactions[fid][fcY], DynamicFactions[fid][fcZ]);
PlayerInfo[playerid][pInt] = DynamicFactions[fid][fInterior];
InHQ[playerid] = fid;
}
return 1;
}