Skripta koju koristim:Freeroamy by Fafu
Detaljan opis problema:Zelim napraviti /stats komandu u kojem ce ona pokazivati igracu njegove Bodove(score), ubojstva i smrti, i da to bude kompatibilno s /check admin koamndom
Dio skripte:
Statsi sto sam napravio CMD:stats(playerid,parmas[])
{
ShowPlayerDialog(playerid,7,DIALOG_STYLE_MSGBOX,"Statistika!","Bodovi:\n\nUbojstva:\n\nSmrti:", "Ok", "Ok");
}
i /check koamnda da bude kompatiblina sa /stats CMD:check(playerid,params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_WHITE, "Koristi: /check ");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Igrac nije online.");
else
{
if (IsPlayerAdmin(playerid) || AdminLevel >= 1)
{
ShowStats(playerid,id);
}
else
{
SendClientMessage(playerid,COLOR_KRED,"Niste autorizirani za koristenje ove komande!");
}
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
[Pomoc] Statsi
739
pregleda
8
postova
27. Apr. 2011.
nti boga nisan ja tolii skripter za to loadanje,sejvanje statsa sam teski bot xS ali znam napraviti neke komande 😄
btw.neznnam ja ko je otvorio 2030 tema na forumu, ja ili samzone ili Mirnas_Tajic,al dosta o tome
evo tebi Disconnect i Connect pa uzmi sto ti treba tu su i oni Diniji
public OnPlayerConnect(playerid)
{
////igraci(textdraw)
igraci ++;
TextDrawHideForAll(players);
new string;
format(string, sizeof(string), "players: %d/10", igraci);
players = TextDrawCreate(507.000000, 102.000000, string);
TextDrawFont(players, 0);
TextDrawColor(players, 16777215);
TextDrawSetOutline(players,1);
TextDrawShowForAll(players);
if(dini_Exists(FileStats(playerid)))
{
LoadStats(playerid);
}
ded = 0;
tele = 0;
Spam = 0;
CarKill = 0;
DriveBy = 0;
SpawnKill = 0;
tiger = 0;
format(string, sizeof(string), "Dobrodosli na iStunt %s by System32", Version);
SendClientMessage(playerid, 0xFF6C6C99, string);
SendClientMessage(playerid, 0x80FF0099, "Upišite /help da vidite listu komandi i teleportova.");
SetPlayerTime(playerid, h, minuty);
TogglePlayerClock(playerid, 2);
esp = TextDrawCreate(550.0,390.0," ");
TextDrawTextSize(esp,550.0,390.0);
TextDrawBackgroundColor(esp, 255);
TextDrawLetterSize(esp, 0.840000, 2.500000);
TextDrawAlignment(esp,0);
TextDrawSetOutline(esp, 1);
TextDrawFont(esp,3);
TextDrawColor(esp,-1);
TextDrawSetProportional(esp,1);
TextDrawSetShadow(esp,0);
gPlayerLogged = 0;
new name, file;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Niste registrirani", "Dobrodosli, niste registrirani. Molimo registrirajte se za daljnje igranje", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registrirani ste", "Dobrodosli, vi ste registrirani. Logirajte se", "Login", "Leave");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
//igraci(textdraw)
igraci--;
new string;
format(string, sizeof(string), "players: %d/10", igraci);
players = TextDrawCreate(507.000000, 102.000000, string);
TextDrawFont(players, 0);
TextDrawColor(players, 16777215);
TextDrawSetOutline(players,1);
TextDrawShowForAll(players);
//speedo
TextDrawHideForPlayer(playerid,esp);
TextDrawDestroy(esp);
if (!dini_Exists(FileStats(playerid)))
{
dini_Create(FileStats(playerid));
}
SaveStats(playerid);
{
if(PlayerO)
{
PlayerO = false;
}
}
new name, file;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged == 1)
{
dini_IntSet(file, "Level", PlayerInfo);
dini_IntSet(file, "Novac", PlayerInfo);
dini_IntSet(file, "AdminLevel",PlayerInfo);
}
gPlayerLogged = 0;
return 1;
}
FileStats(playerid)
{
new a; format(a, sizeof(a), "%s.ini",udb_encode(Player(playerid)));
return a;
}
SaveStats(playerid)
{
dini_IntSet(FileStats(playerid), "admin", AdminLevel);
dini_IntSet(FileStats(playerid), "score", GetPlayerScore(playerid));
dini_IntSet(FileStats(playerid), "money", GetPlayerMoney(playerid));
}
LoadStats(playerid)
{
AdminLevel = dini_Int(FileStats(playerid), "admin");
SetPlayerScore(playerid,dini_Int(FileStats(playerid), "score"));
GivePlayerMoney(playerid,dini_Int(FileStats(playerid), "money"));
}
btw.neznnam ja ko je otvorio 2030 tema na forumu, ja ili samzone ili Mirnas_Tajic,al dosta o tome
evo tebi Disconnect i Connect pa uzmi sto ti treba tu su i oni Diniji
public OnPlayerConnect(playerid)
{
////igraci(textdraw)
igraci ++;
TextDrawHideForAll(players);
new string;
format(string, sizeof(string), "players: %d/10", igraci);
players = TextDrawCreate(507.000000, 102.000000, string);
TextDrawFont(players, 0);
TextDrawColor(players, 16777215);
TextDrawSetOutline(players,1);
TextDrawShowForAll(players);
if(dini_Exists(FileStats(playerid)))
{
LoadStats(playerid);
}
ded = 0;
tele = 0;
Spam = 0;
CarKill = 0;
DriveBy = 0;
SpawnKill = 0;
tiger = 0;
format(string, sizeof(string), "Dobrodosli na iStunt %s by System32", Version);
SendClientMessage(playerid, 0xFF6C6C99, string);
SendClientMessage(playerid, 0x80FF0099, "Upišite /help da vidite listu komandi i teleportova.");
SetPlayerTime(playerid, h, minuty);
TogglePlayerClock(playerid, 2);
esp = TextDrawCreate(550.0,390.0," ");
TextDrawTextSize(esp,550.0,390.0);
TextDrawBackgroundColor(esp, 255);
TextDrawLetterSize(esp, 0.840000, 2.500000);
TextDrawAlignment(esp,0);
TextDrawSetOutline(esp, 1);
TextDrawFont(esp,3);
TextDrawColor(esp,-1);
TextDrawSetProportional(esp,1);
TextDrawSetShadow(esp,0);
gPlayerLogged = 0;
new name, file;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Niste registrirani", "Dobrodosli, niste registrirani. Molimo registrirajte se za daljnje igranje", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registrirani ste", "Dobrodosli, vi ste registrirani. Logirajte se", "Login", "Leave");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
//igraci(textdraw)
igraci--;
new string;
format(string, sizeof(string), "players: %d/10", igraci);
players = TextDrawCreate(507.000000, 102.000000, string);
TextDrawFont(players, 0);
TextDrawColor(players, 16777215);
TextDrawSetOutline(players,1);
TextDrawShowForAll(players);
//speedo
TextDrawHideForPlayer(playerid,esp);
TextDrawDestroy(esp);
if (!dini_Exists(FileStats(playerid)))
{
dini_Create(FileStats(playerid));
}
SaveStats(playerid);
{
if(PlayerO)
{
PlayerO = false;
}
}
new name, file;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged == 1)
{
dini_IntSet(file, "Level", PlayerInfo);
dini_IntSet(file, "Novac", PlayerInfo);
dini_IntSet(file, "AdminLevel",PlayerInfo);
}
gPlayerLogged = 0;
return 1;
}
FileStats(playerid)
{
new a; format(a, sizeof(a), "%s.ini",udb_encode(Player(playerid)));
return a;
}
SaveStats(playerid)
{
dini_IntSet(FileStats(playerid), "admin", AdminLevel);
dini_IntSet(FileStats(playerid), "score", GetPlayerScore(playerid));
dini_IntSet(FileStats(playerid), "money", GetPlayerMoney(playerid));
}
LoadStats(playerid)
{
AdminLevel = dini_Int(FileStats(playerid), "admin");
SetPlayerScore(playerid,dini_Int(FileStats(playerid), "score"));
GivePlayerMoney(playerid,dini_Int(FileStats(playerid), "money"));
}
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava