19.05.2016, 19:08
How do I loaded the leaders inactivity I made offline and online leaders command but I can not figure out how to joke to add that every payday adds +1 inactivity leaders when they connect to the server to be returned to 0.
The command to add leaders and leaders of storing offline, Command /makeleader
The command to load online and offline leader /lideri
The command to add leaders and leaders of storing offline, Command /makeleader
PHP код:
CMD:makeleader(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] > 1337)
{
new id, lider, fajl;
if(sscanf(params, "uii", id, lider, fajl))
{
SCM(playerid,-1, "/makeleader (playerid) (orgid) (fajl (0/1))");
SCM(playerid,-1, "1: Policija | 2: Zandarmerija | 3: Vojska | 4: Bolnica | 5: Ruska Mafia");
SCM(playerid,-1, "6: La Cosa Nosta | 7: Vlada | 8: Zemunski Klan | 9: Novinari | 10: Taxi | 11: Yakuza");
SCM(playerid,-1, "12: Parking Servis | 13: Ballas | 14: Los Surenos | 15: Mara Salvatrucha 13 | 16: Groove Street Family");
SCM(playerid,-1, "17: Hitman | 18: Saobracajna Policija | 19: Policijska Akademija");
return true;
}
if(lider < 0 || lider > 22) return SCM(playerid, COLOR_GRAD1,"Ne moze manje od 0 ili vise od 19!");
if(PlayerInfo[id][pLeader] > 0)
{
if(lider == 0)
{
if(fajl == 1)
{
new ldst[128];
format(ldst,128,"lideri/%d.txt",PlayerInfo[id][pLeader]);
new text[80];
format(text,64,"Nema");
new File:log;
log = fopen(ldst, io_write);
fwrite(log, text);
fclose(log);
}
}
}
if(lider == 0) { SetPlayerSkin(id, 303); PlayerInfo[id][pChar] = 303; }
else if(lider == 1) { SetPlayerSkin(id, 288); PlayerInfo[id][pChar] = 288; }
else if(lider == 2) { SetPlayerSkin(id, 286); PlayerInfo[id][pChar] = 286; }
else if(lider == 3) { SetPlayerSkin(id, 287); PlayerInfo[id][pChar] = 287; }
else if(lider == 4) { SetPlayerSkin(id, 70); PlayerInfo[id][pChar] = 70; }
else if(lider == 5) { SetPlayerSkin(id, 113); PlayerInfo[id][pChar] = 113; }
else if(lider == 6) { SetPlayerSkin(id, 295); PlayerInfo[id][pChar] = 295; }
else if(lider == 7) { SetPlayerSkin(id, 147); PlayerInfo[id][pChar] = 147; }
else if(lider == 8) { SetPlayerSkin(id, 228); PlayerInfo[id][pChar] = 228; }
else if(lider == 9) { SetPlayerSkin(id, 187); PlayerInfo[id][pChar] = 187; }
else if(lider == 10) { SetPlayerSkin(id, 61); PlayerInfo[id][pChar] = 61; }
else if(lider == 11) { SetPlayerSkin(id, 208); PlayerInfo[id][pChar] = 208; }
else if(lider == 12) { SetPlayerSkin(id, 16); PlayerInfo[id][pChar] = 16; }
else if(lider == 13) { SetPlayerSkin(id, 296); PlayerInfo[id][pChar] = 296; }
else if(lider == 14) { SetPlayerSkin(id, 116); PlayerInfo[id][pChar] = 116; }
else if(lider == 15) { SetPlayerSkin(id, 110); PlayerInfo[id][pChar] = 110; }
else if(lider == 16) { SetPlayerSkin(id, 270); PlayerInfo[id][pChar] = 270; }
else if(lider == 17) { SetPlayerSkin(id, 249); PlayerInfo[id][pChar] = 249; }
else if(lider == 18) { SetPlayerSkin(id, 283); PlayerInfo[id][pChar] = 283; }
else if(lider == 19) { SetPlayerSkin(id, 285); PlayerInfo[id][pChar] = 285; }
else if(lider == 20) { SetPlayerSkin(id, 223); PlayerInfo[id][pChar] = 223; }
else if(lider == 21) { SetPlayerSkin(id, 248); PlayerInfo[id][pChar] = 248; }
else if(lider == 22) { SetPlayerSkin(id, 98); PlayerInfo[id][pChar] = 98; }
PlayerInfo[id][pLeader] = lider;
PlayerInfo[id][pMember] = 0;
PlayerInfo[id][pModel] = 303;
if(lider != 0)
{
if(fajl == 1)
{
new ldst[128];
format(ldst,128,"lideri/%d.txt",lider);
new text[80];
format(text,64,"%s",GetNameEx(id));
new File:log;
log = fopen(ldst, io_write);
fwrite(log, text);
fclose(log);
}
}
new fs[3];
if(fajl == 0) { fs = "Ne"; }
else if(fajl == 1) { fs = "Da"; }
if(lider > 0)
{
SCMF(id, -1, ""COL_EXYU"[EX:YU] {FFFFFF}Admin %s ti je dao lidera organizacije ID:%d.", GetName(playerid), lider);
new str[128];
format(str,128,"{FBE204}[{F81414}*{FBE204}] ExYu-Ac // Admin %s je dao gradjaninu %s lidera organizacije ID:%d, pisanje u fajl: %s!", GetName(playerid), GetName(id), lider, fs);
PosaljiAdminima(COLOR_RED, str);
}
else if(lider == 0)
{
SCMF(id, -1, ""COL_EXYU"[EX:YU] {FFFFFF}Admin %s ti je skinuo lidera vase organizacije.", GetName(playerid));
new str[128];
format(str,128,"{FBE204}[{F81414}*{FBE204}] ExYu-Ac // Admin %s je skinuo gradjaninu %s lidera njegove organizacije, pisanje u fajl: %s!", GetName(playerid), GetName(id), fs);
PosaljiAdminima(COLOR_RED, str);
}
SacuvajIgraca(id);
}
else
{
SCM(playerid, COLOR_GRAD1,"Niste ovlasceni za ovu komandu!");
}
return true;
}
PHP код:
if (strcmp(cmd, "/lideri", true) == 0)
{
new text[64];
new File:lider1 = fopen("lideri/1.txt", io_read);
while(fread(lider1, text)) {
strmid(ldr1, text, 0, strlen(text), 255); }
fclose(lider1);
new File:lider2 = fopen("lideri/2.txt", io_read);
while(fread(lider2, text)) {
strmid(ldr2, text, 0, strlen(text), 255); }
fclose(lider2);
new File:lider3 = fopen("lideri/3.txt", io_read);
while(fread(lider3, text)) {
strmid(ldr3, text, 0, strlen(text), 255); }
fclose(lider3);
new File:lider4 = fopen("lideri/4.txt", io_read);
while(fread(lider4, text)) {
strmid(ldr4, text, 0, strlen(text), 255); }
fclose(lider4);
new File:lider5 = fopen("lideri/5.txt", io_read);
while(fread(lider5, text)) {
strmid(ldr5, text, 0, strlen(text), 255); }
fclose(lider5);
new File:lider6 = fopen("lideri/6.txt", io_read);
while(fread(lider6, text)) {
strmid(ldr6, text, 0, strlen(text), 255); }
fclose(lider6);
new File:lider7 = fopen("lideri/7.txt", io_read);
while(fread(lider7, text)) {
strmid(ldr7, text, 0, strlen(text), 255); }
fclose(lider7);
new File:lider8 = fopen("lideri/8.txt", io_read);
while(fread(lider8, text)) {
strmid(ldr8, text, 0, strlen(text), 255); }
fclose(lider8);
new File:lider9 = fopen("lideri/9.txt", io_read);
while(fread(lider9, text)) {
strmid(ldr9, text, 0, strlen(text), 255); }
fclose(lider9);
new File:lider10 = fopen("lideri/10.txt", io_read);
while(fread(lider10, text)) {
strmid(ldr10, text, 0, strlen(text), 255); }
fclose(lider10);
new File:lider11 = fopen("lideri/11.txt", io_read);
while(fread(lider11, text)) {
strmid(ldr11, text, 0, strlen(text), 255); }
fclose(lider11);
new File:lider12 = fopen("lideri/12.txt", io_read);
while(fread(lider12, text)) {
strmid(ldr12, text, 0, strlen(text), 255); }
fclose(lider12);
new File:lider13 = fopen("lideri/13.txt", io_read);
while(fread(lider13, text)) {
strmid(ldr13, text, 0, strlen(text), 255); }
fclose(lider13);
new File:lider14 = fopen("lideri/14.txt", io_read);
while(fread(lider14, text)) {
strmid(ldr14, text, 0, strlen(text), 255); }
fclose(lider14);
new File:lider15 = fopen("lideri/15.txt", io_read);
while(fread(lider15, text)) {
strmid(ldr15, text, 0, strlen(text), 255); }
fclose(lider15);
new File:lider16 = fopen("lideri/16.txt", io_read);
while(fread(lider16, text)) {
strmid(ldr16, text, 0, strlen(text), 255); }
fclose(lider16);
new File:lider17 = fopen("lideri/17.txt", io_read);
while(fread(lider17, text)) {
strmid(ldr17, text, 0, strlen(text), 255); }
fclose(lider17);
new File:lider18 = fopen("lideri/18.txt", io_read);
while(fread(lider18, text)) {
strmid(ldr18, text, 0, strlen(text), 255); }
fclose(lider18);
new File:lider19 = fopen("lideri/19.txt", io_read);
while(fread(lider19, text)) {
strmid(ldr19, text, 0, strlen(text), 255); }
fclose(lider19);
new File:lider20 = fopen("lideri/20.txt", io_read);
while(fread(lider20, text)) {
strmid(ldr20, text, 0, strlen(text), 255); }
fclose(lider20);
new File:lider21 = fopen("lideri/21.txt", io_read);
while(fread(lider21, text)) {
strmid(ldr21, text, 0, strlen(text), 255); }
fclose(lider21);
new File:lider22 = fopen("lideri/22.txt", io_read);
while(fread(lider22, text)) {
strmid(ldr22, text, 0, strlen(text), 255); }
fclose(lider22);
new stringlideri[2600];
new lidercine1[100];
new lidercine2[600];
new lidercine22[600];
new lidercine3[100];
new lidercine4[600];
new lidercine5[600];
new lidercine6[600];
new onllideri[2000];
format(lidercine1,sizeof(lidercine1),"================= [ ONLINE LIDERI ] =================");
format(lidercine2,sizeof(lidercine2),"[LIDER]Policija: %s | 0\n[LIDER]Zandarmerija: %s | 0\n[LIDER]Vojska: %s | 0\n[LIDER]Hitna Pomoc: %s | 0\n[LIDER]Ruska Mafia: %s | 0",ldr1,ldr2,ldr3,ldr4,ldr5);
format(lidercine5,sizeof(lidercine5),"[LIDER]La Cosa Nostra: %s | 0\n[LIDER]Vlada: %s | 0\n[LIDER]Zemunski Klan: %s | 0\n[LIDER]Novinari: %s | 0\n[LIDER]Taxi: %s | 0",ldr6,ldr7,ldr8,ldr9,ldr10);
format(lidercine22,sizeof(lidercine22),"[LIDER]Yakuza: %s | 0\n[LIDER]Parking Servis: %s | 0\n[LIDER]Ballas: %s | 0\n[LIDER]Los Surenos: %s | 0\n[LIDER]Mara Salvatrucha 13: %s | 0\n[LIDER]Groove Street Family: %s | 0",ldr11,ldr12,ldr13,ldr14,ldr15,ldr16);
format(lidercine6,sizeof(lidercine6),"[LIDER]Hitman: %s | 0\n[LIDER]Saobracajna Policija: %s | 0\n[LIDER]Policijska Akademija: %s | 0",ldr17,ldr18,ldr19);
format(lidercine4,sizeof(lidercine4),"[LIDER]Privatna Org.1: %s | 0\n[LIDER]Bajkeri: %s | 0\n[LIDER]Privatna Org.2: %s | 0",ldr20,ldr21,ldr22);
format(lidercine3,sizeof(lidercine3),"================== [ SPISAK SVIH LIDERA ] ===================");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (PlayerInfo[i][pLeader] >= 1)
{
new atext[126];
new admtext[126];
if(PlayerInfo[i][pLeader] == 1) { admtext = "Policija"; }
else if(PlayerInfo[i][pLeader] == 2) { admtext = "Zandarmerija"; }
else if(PlayerInfo[i][pLeader] == 3) { admtext = "Vojska"; }// NOVA ORG
else if(PlayerInfo[i][pLeader] == 4) { admtext = "Hitna Pomoc"; }
else if(PlayerInfo[i][pLeader] == 5) { admtext = "Ruska mafia"; }
else if(PlayerInfo[i][pLeader] == 6) { admtext = "LCN"; }
else if(PlayerInfo[i][pLeader] == 7) { admtext = "Vlada"; }
else if(PlayerInfo[i][pLeader] == 8) { admtext = "Zemunski Klan"; }
else if(PlayerInfo[i][pLeader] == 9) { admtext = "Novinari"; }
else if(PlayerInfo[i][pLeader] == 10) { admtext = "Taxi"; }
else if(PlayerInfo[i][pLeader] == 11) { admtext = "Yakuza"; }
else if(PlayerInfo[i][pLeader] == 12) { admtext = "Parking Servis"; }
else if(PlayerInfo[i][pLeader] == 13) { admtext = "Ballas Family"; }
else if(PlayerInfo[i][pLeader] == 14) { admtext = "Los Surenos"; }
else if(PlayerInfo[i][pLeader] == 15) { admtext = "MS-13"; }
else if(PlayerInfo[i][pLeader] == 16) { admtext = "Grove Street Family"; }
else if(PlayerInfo[i][pLeader] == 17) { admtext = "Hitman"; }
else if(PlayerInfo[i][pLeader] == 18) { admtext = "Saobracajna Policija"; }
else if(PlayerInfo[i][pLeader] == 19) { admtext = "Policijska Akademija"; }
else if(PlayerInfo[i][pLeader] == 20) { admtext = "Privatna Org. 1"; }
else if(PlayerInfo[i][pLeader] == 21) { admtext = "Bajkeri"; }
else if(PlayerInfo[i][pLeader] == 22) { admtext = "Privatna Org. 2"; }
format(atext, sizeof(atext), "%s | [%d]",GetName(i),i);
strcat(onllideri, atext);
strcat(onllideri, " | ");
format(atext, sizeof(atext), " Lider: %s | Grad: Beograd",admtext);
strcat(onllideri, atext);
strcat(onllideri, "\n");
}
}
format(stringlideri,sizeof(stringlideri),"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",lidercine1,onllideri,lidercine3,lidercine2,lidercine5,lidercine6,lidercine22,lidercine4);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s gleda listu online lidera (/lideri) .", sendername);
ProxDetector(30.0, playerid, string, PURPLE1,PURPLE2,PURPLE3,PURPLE4,PURPLE5);
ShowPlayerDialog(playerid, Administracija, DIALOG_STYLE_MSGBOX, "Lideri EX-YU servera", stringlideri, "OK", "OK");
return 1;
}