[HELP]Command
#1

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
PHP код:
CMD:makeleader(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] > 1337)
    {
    new 
idliderfajl;
    if(
sscanf(params"uii"idliderfajl))
    {
         
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 || lider 22) return SCM(playeridCOLOR_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(ldstio_write);
                
fwrite(logtext);
                
fclose(log);
            }
        }
    }
    if(
lider == 0) { SetPlayerSkin(id303); PlayerInfo[id][pChar] = 303; }
    else if(
lider == 1) { SetPlayerSkin(id288); PlayerInfo[id][pChar] = 288; }
    else if(
lider == 2) { SetPlayerSkin(id286); PlayerInfo[id][pChar] = 286; }
    else if(
lider == 3) { SetPlayerSkin(id287); PlayerInfo[id][pChar] = 287; }
    else if(
lider == 4) { SetPlayerSkin(id70); PlayerInfo[id][pChar] = 70; }
    else if(
lider == 5) { SetPlayerSkin(id113); PlayerInfo[id][pChar] = 113; }
    else if(
lider == 6) { SetPlayerSkin(id295); PlayerInfo[id][pChar] = 295; }
    else if(
lider == 7) { SetPlayerSkin(id147); PlayerInfo[id][pChar] = 147; }
    else if(
lider == 8) { SetPlayerSkin(id228); PlayerInfo[id][pChar] = 228; }
    else if(
lider == 9) { SetPlayerSkin(id187); PlayerInfo[id][pChar] = 187; }
    else if(
lider == 10) { SetPlayerSkin(id61); PlayerInfo[id][pChar] = 61; }
    else if(
lider == 11) { SetPlayerSkin(id208); PlayerInfo[id][pChar] = 208; }
    else if(
lider == 12) { SetPlayerSkin(id16); PlayerInfo[id][pChar] = 16; }
    else if(
lider == 13) { SetPlayerSkin(id296); PlayerInfo[id][pChar] = 296; }
    else if(
lider == 14) { SetPlayerSkin(id116); PlayerInfo[id][pChar] = 116; }
    else if(
lider == 15) { SetPlayerSkin(id110); PlayerInfo[id][pChar] = 110; }
    else if(
lider == 16) { SetPlayerSkin(id270); PlayerInfo[id][pChar] = 270; }
    else if(
lider == 17) { SetPlayerSkin(id249); PlayerInfo[id][pChar] = 249; }
    else if(
lider == 18) { SetPlayerSkin(id283); PlayerInfo[id][pChar] = 283; }
    else if(
lider == 19) { SetPlayerSkin(id285); PlayerInfo[id][pChar] = 285; }
    else if(
lider == 20) { SetPlayerSkin(id223); PlayerInfo[id][pChar] = 223; }
    else if(
lider == 21) { SetPlayerSkin(id248); PlayerInfo[id][pChar] = 248; }
    else if(
lider == 22) { SetPlayerSkin(id98); 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(ldstio_write);
            
fwrite(logtext);
            
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), liderfs);
        
PosaljiAdminima(COLOR_REDstr);
    }
    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_REDstr);
    }
    
SacuvajIgraca(id);
    }
    else
    {
    
SCM(playeridCOLOR_GRAD1,"Niste ovlasceni za ovu komandu!");
    }
    return 
true;

The command to load online and offline leader /lideri
PHP код:
  if (strcmp(cmd"/lideri"true) == 0)
     {
     new 
text[64];
     new 
File:lider1 fopen("lideri/1.txt"io_read);
     while(
fread(lider1text)) {
     
strmid(ldr1text0strlen(text), 255); }
     
fclose(lider1);
     new 
File:lider2 fopen("lideri/2.txt"io_read);
     while(
fread(lider2text)) {
     
strmid(ldr2text0strlen(text), 255); }
     
fclose(lider2);
     new 
File:lider3 fopen("lideri/3.txt"io_read);
     while(
fread(lider3text)) {
     
strmid(ldr3text0strlen(text), 255); }
     
fclose(lider3);
     new 
File:lider4 fopen("lideri/4.txt"io_read);
     while(
fread(lider4text)) {
     
strmid(ldr4text0strlen(text), 255); }
     
fclose(lider4);
     new 
File:lider5 fopen("lideri/5.txt"io_read);
     while(
fread(lider5text)) {
     
strmid(ldr5text0strlen(text), 255); }
     
fclose(lider5);
     new 
File:lider6 fopen("lideri/6.txt"io_read);
     while(
fread(lider6text)) {
     
strmid(ldr6text0strlen(text), 255); }
     
fclose(lider6);
     new 
File:lider7 fopen("lideri/7.txt"io_read);
     while(
fread(lider7text)) {
     
strmid(ldr7text0strlen(text), 255); }
     
fclose(lider7);
     new 
File:lider8 fopen("lideri/8.txt"io_read);
     while(
fread(lider8text)) {
     
strmid(ldr8text0strlen(text), 255); }
     
fclose(lider8);
     new 
File:lider9 fopen("lideri/9.txt"io_read);
     while(
fread(lider9text)) {
     
strmid(ldr9text0strlen(text), 255); }
     
fclose(lider9);
     new 
File:lider10 fopen("lideri/10.txt"io_read);
     while(
fread(lider10text)) {
     
strmid(ldr10text0strlen(text), 255); }
     
fclose(lider10);
     new 
File:lider11 fopen("lideri/11.txt"io_read);
     while(
fread(lider11text)) {
     
strmid(ldr11text0strlen(text), 255); }
     
fclose(lider11);
     new 
File:lider12 fopen("lideri/12.txt"io_read);
     while(
fread(lider12text)) {
     
strmid(ldr12text0strlen(text), 255); }
     
fclose(lider12);
     new 
File:lider13 fopen("lideri/13.txt"io_read);
     while(
fread(lider13text)) {
     
strmid(ldr13text0strlen(text), 255); }
     
fclose(lider13);
     new 
File:lider14 fopen("lideri/14.txt"io_read);
     while(
fread(lider14text)) {
     
strmid(ldr14text0strlen(text), 255); }
     
fclose(lider14);
     new 
File:lider15 fopen("lideri/15.txt"io_read);
     while(
fread(lider15text)) {
     
strmid(ldr15text0strlen(text), 255); }
     
fclose(lider15);
     new 
File:lider16 fopen("lideri/16.txt"io_read);
     while(
fread(lider16text)) {
     
strmid(ldr16text0strlen(text), 255); }
     
fclose(lider16);
     new 
File:lider17 fopen("lideri/17.txt"io_read);
     while(
fread(lider17text)) {
     
strmid(ldr17text0strlen(text), 255); }
     
fclose(lider17);
     new 
File:lider18 fopen("lideri/18.txt"io_read);
     while(
fread(lider18text)) {
     
strmid(ldr18text0strlen(text), 255); }
     
fclose(lider18);
     new 
File:lider19 fopen("lideri/19.txt"io_read);
     while(
fread(lider19text)) {
     
strmid(ldr19text0strlen(text), 255); }
     
fclose(lider19);
     
     new 
File:lider20 fopen("lideri/20.txt"io_read);
     while(
fread(lider20text)) {
     
strmid(ldr20text0strlen(text), 255); }
     
fclose(lider20);
     
     new 
File:lider21 fopen("lideri/21.txt"io_read);
     while(
fread(lider21text)) {
     
strmid(ldr21text0strlen(text), 255); }
     
fclose(lider21);
     
     new 
File:lider22 fopen("lideri/22.txt"io_read);
     while(
fread(lider22text)) {
     
strmid(ldr22text0strlen(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 
0MAX_PLAYERSi++)
           {
                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(atextsizeof(atext), "%s | [%d]",GetName(i),i);
                       
strcat(onllideriatext);
                    
strcat(onllideri" | ");
                    
format(atextsizeof(atext), " Lider: %s | Grad: Beograd",admtext);
                       
strcat(onllideriatext);
                       
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(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* %s gleda listu online lidera (/lideri) ."sendername);
                
ProxDetector(30.0playeridstringPURPLE1,PURPLE2,PURPLE3,PURPLE4,PURPLE5);
                
ShowPlayerDialog(playeridAdministracijaDIALOG_STYLE_MSGBOX"Lideri EX-YU servera"stringlideri"OK""OK");
                return 
1;
              } 
Reply
#2

BUMP!
Reply
#3

I will just give you steps on how to do it yourself:

first you need to add a variable that saves called 'LeaderInactivity' and once a player registers it gives him 0
now go to paycheck and check if the player is leader then add +1 to 'LeaderInactivity' example:
pawn Код:
public Payday(playerid)
{
if(pInfo[playerid][IsLeader] > 0)
{
LeaderInactivity[playerid] += 1;
}

}

now the variable should save when player quits the server or on your save stats function.
and to show his inactivity, you can add it inside the dialog and format the string to %d and show his variable value.

thats all, you have to figure out how to script it your own, but what I mostly wrote to you, is steps that you should follow in order to make it work.
Reply
#4

How to define the command that shows how many inactive
Reply
#5

Bump!
Reply
#6

BUMP!
Reply
#7

Bumping is only allowed after 24 hours.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)