little help.
#1

Hello boys & girls am a little confused on this part here & i just cant seem to find out what the issue is so here we go

whenever i make my self into a faction leader then i log out of the server it spawns the player under the blueberry map if somebody can point out what the issue is i would be thankful.

quit faction command
Код:
	if(strcmp(cmd, "/quitfaction", true) == 0)
	{
	   if(PlayerInfo[playerid][pAdmin] >= 1)
	   {
	       GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
	       SendClientMessage(playerid, COLOR_LIGHTRED, "You have quitted from your faction");
	       PlayerInfo[playerid][pLeader] = 0;
	       if(WeaponsLoaded[playerid] == 1)
		   {
   				WeaponsLoaded[playerid] = 0;
		   }
	       Otman_ResetPlayerWeapons(playerid);
	       PlayerInfo[playerid][pMember] = 0;
	       PlayerInfo[playerid][pRank] = 0;
	       SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
	       //SpawnPlayer(playerid);
	   }
	   return 1;
	}
here is the part were making your self leader.
Код:
if(strcmp(cmd, "/makeleader", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}/makeleader [ID or Name/Part of name] [Number(1-9)]");
				SendClientMessage(playerid, COLOR_WHITE, "Factions: 1: LSPD | 2: SASD | 3: LVPD | 4: SFPD ");
				SendClientMessage(playerid, COLOR_WHITE, "5: FBI | 6: NG | 7: Triads | 8: Italian | 9: Russian");
				SendClientMessage(playerid, COLOR_WHITE, " 10: HitMen | 11: Taxi Cab | 12: Grove ");
				return 1;
			}
			new playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			new level = strval(tmp);
			if(level < 1 || level > 13)
			{
				SendClientMessage(playerid, COLOR_GREY, "{FFFFFF}/From [1-12]");
				SendClientMessage(playerid, COLOR_WHITE, "Factions: 1: LSPD | 2: SASD | 3: LVPD | 4: SFPD ");
				SendClientMessage(playerid, COLOR_WHITE, "5: FBI | 6: NG | 7: Triads | 8: Italian | 9: Russian");
				SendClientMessage(playerid, COLOR_WHITE, " 10: HitMen | 11: Taxi Cab | 12: Grove ");
				return 1;
			}
			if (PlayerInfo[playerid][pAdmin] >= 1337)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
			            if(PlayerInfo[playa][pMember] > 0)
			            {
			                SendClientMessage(playerid, COLOR_GREY, "That player is in a Faction");
			                return 1;
			            }
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[playa][pLeader] = level;
						PlayerInfo[playa][pMember] = level;
						format(string, sizeof(string), "You Are Now A Faction Leader by Admin %s", sendername);
						SendClientMessage(playa, COLOR_LIGHTRED, string);
						format(string, sizeof(string), "You have given %s control to run Faction Number %d", giveplayer,level);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						if(level == 1) { PlayerInfo[playa][pChar] = 288; PlayerInfo[playa][pRank] = 8; } // LSPD
						else if(level == 2) { PlayerInfo[playa][pChar] = 289; PlayerInfo[playa][pRank] = 8; } // SASD
						else if(level == 3) { PlayerInfo[playa][pChar] = 289; PlayerInfo[playa][pRank] = 8; }  // LVPD
						else if(level == 4) { PlayerInfo[playa][pChar] = 289; PlayerInfo[playa][pRank] = 8; } // SFPD
						else if(level == 5) { PlayerInfo[playa][pChar] = 286; PlayerInfo[playa][pRank] = 8; } //FBI
						else if(level == 6) { PlayerInfo[playa][pChar] = 289; PlayerInfo[playa][pRank] = 8; } // NG
						else if(level == 7) { PlayerInfo[playa][pChar] = 186; PlayerInfo[playa][pRank] = 8; } //Triads
						else if(level == 8) { PlayerInfo[playa][pChar] = 111; PlayerInfo[playa][pRank] = 8; } //Italian
						else if(level == 9) { PlayerInfo[playa][pChar] = 113; PlayerInfo[playa][pRank] = 8; } //Russian
						else if(level == 10) { PlayerInfo[playa][pChar] = 294; PlayerInfo[playa][pRank] = 8; } //Hitmans
						else if(level == 11) { PlayerInfo[playa][pChar] = 61; PlayerInfo[playa][pRank] = 8; } //Taxi Cab Company
						else if(level == 12) { PlayerInfo[playa][pChar] = 107; PlayerInfo[playa][pRank] = 8; } //Grove Gang
					    SetPlayerSkin(playa, PlayerInfo[playa][pChar]);
					    UpdatePlayerInfo(playa);
					    //SetPlayerSpawn(playa);
					}
				}
			}
		}
		return 1;
	}
on player spawn not sure if this would be the issue.
Код:
public OnPlayerSpawn(playerid)
{
	if(Logged[playerid] == 0)
	{
        SendClientMessage(playerid, COLOR_RED, "You Need to Login First To Spawn [kicked]");
        Kick(playerid);
 	}
 	if(PlayerDead[playerid] == 1)
 	{
        PlayerDead[playerid] = 0;
	}
 	Otman_OnPlayerSpawn(playerid);
    if(PlayerInfo[playerid][pMember] == 0)
    {
        if(PlayerInfo[playerid][pTut] == 0)
        {
            SetPlayerPos(playerid, 1686.0055,-2238.4497,13.5469); // Tutorial starts LS Airport
            SetPlayerFacingAngle(playerid,179.9150);
            SetPlayerCameraPos(playerid, 1685.5326,-2253.0974,15.3937);
            SetPlayerCameraLookAt(playerid, 1686.0055,-2238.4497,13.5469);
            SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
            SetPlayerColor(playerid,COLOR_WHITE);
            SetPlayerInterior(playerid,0);
            PlayerInfo[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, 0);
            TutTime[playerid] = 1;
            UpdatePlayerInfo(playerid);
		}
		else if(PlayerInfo[playerid][pTut] == 1)
        {
			if(PlaneSpawn[playerid] == 1)
			{
                SetPlayerVirtualWorld(playerid,0);
                SetPlayerPos(playerid, 1685.8019,-2238.4919,13.5469);
                SetPlayerFacingAngle(playerid,179.9150); // NoobSpawn LS Airport
                SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
                Freezed[playerid] = 0;
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerColor(playerid,COLOR_WHITE);
                TogglePlayerControllable(playerid, 1);
                UpdatePlayerInfo(playerid);
                LoopingAnim(playerid,"PED","WALK_civi",4.1,1,1,1,1,1);
                gPlayerUsingLoopingAnim[playerid] = 2;
                SetTimerEx("WalkTimer",6000, false,"i",playerid);
                UpdatePlayerInfo(playerid);
			}
			else
			{
                SetPlayerPos(playerid, 1685.8019,-2238.4919,13.5469);
                SetPlayerFacingAngle(playerid,179.9150); // NoobSpawn LS Airport
                SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
                SetPlayerInterior(playerid,0);
                PlayerInfo[playerid][pInt] = 0;
                SetPlayerColor(playerid,COLOR_WHITE);
                TogglePlayerControllable(playerid, 1);
                UpdatePlayerInfo(playerid);
			}
        }
Reply
#2

why you dont use sscanf?

it's more easy do that..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)