Kreira Racun bez potrebe.

Započeo Plen Ki Mun
13. Mar. 2018. Zaključano
528
pregleda
7
postova
Mate
5
Underboss
13. Mar. 2018.
Problem(error/warning): Uradio sam nešto, ali svaki puta kada igraca izbaci sa servera a nije registriran niti mu je potreban login napravi se racun s njegovim imenom
Dio skripte: Evo primjer za ovo. Ako nešto zatreba javite. Koristim YINI spremanje/cuvanje

public OnPlayerConnect(playerid)
{
if(strfind(GetName(playerid),"",true) != -1)
{
    new string[ 105 ];
format(string, sizeof(string), "%s je izbacen je koristi nedozvoljen tag u imenu!", GetName(playerid));
SCMToAll( -1,string);
Kick(playerid);
return 1;
}
}


public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PInfo);
INI_WriteInt(File,"Deaths",PInfo);
INI_WriteInt(File,"Score", GetPlayerScore(playerid));
INI_WriteInt(File,"Tag",PInfo);
INI_Close(File);

SaveStats(playerid);
}


stock SaveStats(playerid)
{
if(IsPlayerConnected(playerid))
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PInfo);
INI_WriteInt(File,"Deaths",PInfo);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Tag",PInfo);
INI_Close(File);
}
return 1;
}



Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]//[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): //
Rax_King
5
Godfather
13. Mar. 2018.
Kick poziva diskonekt igraca.
Mate
5
Underboss
13. Mar. 2018.
.ксундер wrote on March 13, 2018, 4:11 pm:
Kick poziva diskonekt igraca.


To je točno, ali i dalje ne kuzim  😄
nickydefacto
4
Made Man
13. Mar. 2018.
http://prntscr.com/iqogq0 tfq?
Mate
5
Underboss
13. Mar. 2018.
KSHM Nicky wrote on March 13, 2018, 4:16 pm:
http://prntscr.com/iqogq0 tfq?


Ali nije do toga, pokusao sam i sa time da potpuno uklonim SaveStats ali isto se događa.
Rax_King
5
Godfather
13. Mar. 2018.
Pa moras uglonit save stats za acc koji ne postoji ex.

public OnPlayerDisconnect(playerid, reason)
{
if (fexist(UserPath(playerid)) {
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PInfo);
INI_WriteInt(File,"Deaths",PInfo);
INI_WriteInt(File,"Score", GetPlayerScore(playerid));
INI_WriteInt(File,"Tag",PInfo);
INI_Close(File);

SaveStats(playerid);
}
}
Mate
5
Underboss
13. Mar. 2018.
Hvala ti puno.

- Riješeno

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha