Not spawning by itself - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not spawning by itself (
/showthread.php?tid=130691)
Not spawning by itself -
Torran - 27.02.2010
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?
Re: Not spawning by itself -
[HiC]TheKiller - 27.02.2010
It may be something to do with the spectating toggle right before. Just for a test, make a 1 second timer after the spectate and spawn the player after the one second. See what happens
.
Re: Not spawning by itself -
Torran - 28.02.2010
Not working
Re: Not spawning by itself -
Onyx09 - 28.02.2010
everything looks right to me
hope you get help soon maybe someone knows how to fix this
Re: Not spawning by itself -
Torran - 28.02.2010
Not working, It refuses to spawn the player
Anyone know?
Re: Not spawning by itself -
Torran - 01.03.2010
Still no-one? Please i really REALLY need to fix this!