Problems spawning with admin power
#1

i Fixed my whole server so its able to compile with no errors. but now look i made my self admin and now i keep crashing when i remove my admin i dont crash.Thanks for helping.Please let me know how i can fix this or add me on skype if you can help my skype is kris.damjanovic1

If you help me i will give you something in return,Like my mappings,a private car mod for sa or a admin or faction spot.So please please help.I would really appreciate it.


http://oi44.tinypic.com/2jxfkn.jpg
Reply
#2

Show us you OnPlayerSpawn
Reply
#3

Quote:
Originally Posted by Necip
Посмотреть сообщение
Show us you OnPlayerSpawn
PHP код:
public OnPlayerSpawn(playerid)
{
    
// Anti F4 Bug - Logging/Registering
    
if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
    {
        if(
IsPlayerNPC(playerid)) return 1;
        
SetPlayerPos(playerid1975.2030023779.311523, -50.243506);
        
SetPlayerCameraPos(playerid1975.2030023779.311523100.243506);
        
SetPlayerCameraLookAt(playerid1975.2030023779.311523, -0.243506);
        
SetSpawnInfoplayerid000000000000);
        new 
file[64];
        
format(filesizeof(file), "users/%s.ini"RPNU(playerid));
        
// Player isn't banned
        
if(dini_Int(file"AdminAccount") == 1)
        {
            
format(filesizeof(file), "users/%s.ini",RPNU(playerid));
            
SetPlayerName(playeriddini_Get(file"OldName"));
            
format(filesizeof(file), "users/%s.ini"RPNU(playerid));
            
ShowDialog(playerid2);
        }
        if(!
dini_Exists(file))
        {
            
ShowDialog(playerid1);
            return 
1;
        }
        else
        {
            
ShowDialog(playerid2);
        }
        return 
1;
    }
    
// Actual Spawning
    
ResetPlayerWeapons(playerid);
    if(
IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
    
{
      new 
npcname[MAX_PLAYER_NAME];
      
GetPlayerName(playeridnpcnamesizeof(npcname)); //Getting the NPC's name.
      
if(!strcmp(npcname"BusDriver"true)) //Checking if the NPC's name is BusDriver
      
{
        
PutPlayerInVehicle(playeridNPCBus0); //Putting the NPC into the vehicle we created for it.
        
return 1;
      }
      return 
1;
    }
    if(
PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        
FalseBan[playerid] = 0;
        
SetTimerEx("FalseBanFix"6000false"i"playerid);
        
SpawnChar(playerid);
    }
    return 
1;

Reply
#4

this shouldnd be

Код:
if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
to

Код:
if(PlayerInfo[playerid][pLoggedIn] == 1 && PlayerInfo[playerid][pSpawn] == 1)
or ye you can use if not ! or use == 0
Reply
#5

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
this shouldnd be

Код:
if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
to

Код:
if(PlayerInfo[playerid][pLoggedIn] == 1 && PlayerInfo[playerid][pSpawn] == 1)
or ye you can use if not ! or use == 0
Still kicks me.i used if(PlayerInfo[playerid][pLoggedIn] == 1 && PlayerInfo[playerid][pSpawn] == 1)


what do i change to a 0?
Reply
#6

Quote:
Originally Posted by Drake Star
Посмотреть сообщение
Still kicks me.i used if(PlayerInfo[playerid][pLoggedIn] == 1 && PlayerInfo[playerid][pSpawn] == 1)


what do i change to a 0?
Please provide us the FalseBanFix(playerid) function as well.
SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
Reply
#7

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
    {
        SetPlayerPos(playerid, 1975.203002, 3779.311523, -50.243506);
        SetPlayerCameraPos(playerid, 1975.203002, 3779.311523, 100.243506);
        SetPlayerCameraLookAt(playerid, 1975.203002, 3779.311523, -0.243506);
        SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        new file[64];
        format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
        // Player isn't banned
        if(dini_Int(file, "AdminAccount") == 1)
        {
            format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
            SetPlayerName(playerid, dini_Get(file, "OldName"));
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            ShowDialog(playerid, 2);
        }
        if(!dini_Exists(file))
        {
            ShowDialog(playerid, 1);
            return 1;
        }
        else
        {
            ShowDialog(playerid, 2);
        }
        return 1;
    }
    if(IsPlayerNPC(playerid))
    {
        new NPCName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,NPCName,sizeof(NPCName));
        if(!strcmp(NPCName,"Priest",true))
        {
            SetPlayerSkin(playerid,68);
            SetPlayerPos(playerid,-2023.2181,1094.6647,19.0025);
            SetPlayerColor(playerid,0x000000FF);
            SetPlayerFacingAngle(playerid,-180.0);
            new string[128];
            format(string,sizeof(string),"%s",NPCName);
            PriestName = Create3DTextLabel(string,0xFDE39DFF,0.0,0.0,0.0,10.0,0,0);
            Attach3DTextLabelToPlayer(PriestName,playerid,0.0,0.0,0.2);
            return 1;
        }
    }
    SetPlayerMapIcon(playerid,0,-1989.7310,1117.9515,54.4688,21,-1);
    new name[24]; // Makes a new string for the name
    GetPlayerName(playerid, name, 24);
    ResetPlayerWeapons(playerid);
    if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
    {
        FalseBan[playerid] = 0;
        SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
        SpawnChar(playerid);
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by Income
Посмотреть сообщение
Please provide us the FalseBanFix(playerid) function as well.
SetTimerEx("FalseBanFix", 6000, false, "i", playerid);
I fixed the crash thing but now when i log in i dont spawn in fort carson i spawn in dillimore next to the farm.I fall throught the map then spawn near the farm,And when i die it spawns me near the farm


i made the line like this if(PlayerInfo[playerid][pLoggedIn] == 0 && PlayerInfo[playerid][pSpawn] == 0)
Reply
#9

Delete please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)