Not spawning by itself
#1

Heres my code: Of SeifAdmin

pawn Код:
public OnPlayerLogin(playerid, password[])
{
  new name[MAX_PLAYER_NAME], str[128];
  GetPlayerName(playerid, name, sizeof name);
    format(str, sizeof str, "/Roleplay/%s.cfg", name);
    new File:account = fopen(str, io_read);
    if (account)
    {
      new pass[256];
      new passres[256], value[256];
      fread(account, pass, sizeof pass);
      passres = GetFileString(pass);
      if (!strcmp("Password", passres))
        {
            value = GetFileValue(pass);
            strmid(AccountInfo[playerid][Password], value, 0, strlen(value), 150);
        }
        if (!strcmp(AccountInfo[playerid][Password], password, true))
        {
          while (fread(account, pass, 256))
            {
                passres = GetFileString(pass);
                if (!strcmp("AdminLevel", passres, true))
                {
                    value = GetFileValue(pass);
                    AccountInfo[playerid][AdminLevel] = strval(value);
                }
                if (!strcmp("Cash", passres, true))
                {
                    value = GetFileValue(pass);
                    AccountInfo[playerid][Cash] = strval(value);
                }
                if (!strcmp("Score", passres, true))
                {
                    value = GetFileValue(pass);
                    AccountInfo[playerid][Score] = strval(value);
                }
        if (!strcmp("Warnings", passres, true))
                {
                    value = GetFileValue(pass);
                    AccountInfo[playerid][Warns] = strval(value);
                }
                if (!strcmp("WarnReason1", passres, true))
                {
                    value = GetFileValue(pass);
                    strmid(AccountInfo[playerid][WarnReason1], value, 0, strlen(value), 128);
                }
                if (!strcmp("WarnReason2", passres, true))
                {
                    value = GetFileValue(pass);
                    strmid(AccountInfo[playerid][WarnReason2], value, 0, strlen(value), 128);
                }
            if (!strcmp("WarnReason3", passres, true))
                {
                    value = GetFileValue(pass);
                    strmid(AccountInfo[playerid][WarnReason3], value, 0, strlen(value), 128);
                }
            }
            fclose(account);
      AccountInfo[playerid][Logged] = 1;
        }
        else
        {
            SendClientMessage(playerid, RED, "Incorrect Password.");
        fclose(account);
        return 1;
        }
        GivePlayerMoney(playerid, AccountInfo[playerid][Cash]);
        SetPlayerScore(playerid, AccountInfo[playerid][Score]);
        format(str, sizeof str, "|- You have successfully logged in as %s -|", name);
        SendClientMessage(playerid, GREEN, str);
        printf("%s has logged in", name);
        TogglePlayerSpectating(playerid, 0);
        SpawnPlayer(playerid);
        if (AccountInfo[playerid][AdminLevel] > 0)
        {
        format(str, sizeof str, "|» You are now logged in as a level %d admin «|", AccountInfo[playerid][AdminLevel]);
            SendClientMessage(playerid, LIGHTGREEN, str);
            ViewCmds[playerid] = 0;
        }
    }
    return 1;
}
As you see at the bottom of that code is

pawn Код:
TogglePlayerSpectating(playerid, 0);
        SpawnPlayer(playerid);
Well it turns of spectating but it dosent spawn me, Why?
Reply


Messages In This Thread
Not spawning by itself - by Torran - 27.02.2010, 22:23
Re: Not spawning by itself - by [HiC]TheKiller - 27.02.2010, 22:36
Re: Not spawning by itself - by Torran - 28.02.2010, 16:26
Re: Not spawning by itself - by Onyx09 - 28.02.2010, 21:06
Re: Not spawning by itself - by Torran - 28.02.2010, 23:19
Re: Not spawning by itself - by Torran - 01.03.2010, 09:56

Forum Jump:


Users browsing this thread: 1 Guest(s)