Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerSpawn(playerid)
- {
- new sfID,Float:sx,Float:sy,Float:sz;
- sfID = PlayerInfo[playerid][Faction];
- if(PlayerInfo[playerid][Faction] != 0 && FactionInfo[sfID][SpawnSet] == true) {
- sx = FactionInfo[sfID][SpawnX];
- sy = FactionInfo[sfID][SpawnY];
- sz = FactionInfo[sfID][SpawnZ];
- SetPlayerPos(playerid,sx,sy,sz);
- }else if(PlayerInfo[playerid][aJailed] > 1) {
- PlaceInAjail(playerid);
- } else {
- SetPlayerPos(playerid,1641.9503,-2333.8657,-2.6797);
- }
- SetPlayerColor(playerid, COLOR_WHITE);
- SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
- return 1;
- }
- **********Command**************
- CMD:setfactionspawn(playerid,params[])
- {
- new pfID,string[100],Float:x,Float:y,Float:z,astring[100],lName[MAX_PLAYER_NAME];
- if(PlayerInfo[playerid][Faction] == 0) return SendClientMessage(playerid,COLOR_RED,"You are not currently in a faction!");
- if(PlayerInfo[playerid][Rank] >= 9) {
- pfID = PlayerInfo[playerid][Faction];
- GetPlayerPos(playerid, x, y, z);
- FactionInfo[pfID][SpawnX] = x;
- FactionInfo[pfID][SpawnY] = y;
- FactionInfo[pfID][SpawnZ] = z;
- FactionInfo[pfID][SpawnSet] = true;
- new path[40];
- format(path,sizeof(path),"/factions/%i.ini",pfID);
- new INI:File = INI_Open(path);
- INI_SetTag(File,"Faction Data");
- INI_WriteFloat(File,"Spawn X",FactionInfo[pfID][SpawnX]);
- INI_WriteFloat(File,"Spawn Y",FactionInfo[pfID][SpawnY]);
- INI_WriteFloat(File,"Spawn Z",FactionInfo[pfID][SpawnZ]);
- INI_WriteBool(File,"Spawn Set",FactionInfo[pfID][SpawnSet]);
- INI_Close(File);
- GetPlayerName(playerid,lName,sizeof(lName));
- format(string,100,"Faction Leader %s has set the faction spawn.",lName);
- SendFactionMessage(playerid,FACTION_BLUE,string);
- format(astring,256,"{F81414}System:{FF6600}%s has set the Faction spawn for %s.",lName,FactionInfo[pfID][fName]);
- SendAdminMessage(-1,astring);
- }else{
- SendClientMessage(playerid,COLOR_RED,"You are not a high enough rank in your faction to do this!");
- }
- return 1;
- }
- ****Load****
- INI_Float("Spawn X", FactionInfo[factionids][SpawnX]);
- INI_Float("Spawn Y", FactionInfo[factionids][SpawnY]);
- INI_Float("Spawn Z", FactionInfo[factionids][SpawnZ]);
- INI_Bool("Spawn Set",FactionInfo[factionids][SpawnSet]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement