[AJUDA] Colocar Sistema de Vip Automatico
#3

Procure por new PlayerInfo no seu GM e duas linhas antes do };, coloque isto:

Код:
pDays,
Lembre-se, tambйm, de fazer o saving e loading da variavel.

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
PlayerInfo[playerid][pVIP] != && gettime() >= PlayerInfo[playerid][pDays])
    {
        
SendClientMessage(playerid, -1"Seu perнodo de VIP acabou.");
        
PlayerInfo[giveid][pVIP] = 0;
        
PlayerInfo[playerid][pDays] = 0;
        new 
sStr[24];
        
GetPlayerName(playeridsStr24);
        for(new 
0sizeof(VipInfo); i++)
        {
            if(
strcmp(sStr,VipInfo[i][vNick],true)==0)
            {
                
VipInfo[i][vTipo] = 0;
                
strmid(VipInfo[i][vNick], "Ninguem"016255);
                return 
SaveVip();
            }
        }
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmd"/darvip"true) == 0)
    {
        if(
PlayerInfo[playerid][pAdmin] < 1337)
            return 
SendClientMessage(playeridCOLOR_GRAD1"Vocк nгo tem autorizaзгo para usar esse comando.");
        
VipVaga();
        if(!
VagaSobrando)
            return 
SendClientMessage(playeridCOLOR_GRAD1"Nгo hб mais vagas na lista use /limparvip primeiro.");
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [nivel] [dias]");
        new 
giveid ReturnUser(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [nivel] [dias]");
        new 
level strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
            return 
SendClientMessage(playeridCOLOR_GRAD2"USE: /darvip [id] [nivel] [dias]");
        new 
dias strval(tmp);
        
GetPlayerName(giveidgiveplayersizeof(giveplayer));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        if(!
IsPlayerConnected(giveid) || giveid != INVALID_PLAYER_ID)
            return 
1;
        
format(stringsizeof string"Vocк deu VIP Nнvel %d para %s por %d dias"levelgiveplayerdias);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        
format(stringsizeof string"Vocк ganhou VIP Nнvel %d por %d dias do admin %s"leveldiassendername);
        
SendClientMessage(giveidCOLOR_LIGHTBLUEstring);
        
getdate(yearmonthday);
        
gettime(hour,minute,second);
        
format(stringsizeof(string), "%s deu vip ao %s nнvel %d por %d dias (%d/%d/%d - %d:%d)",sendername,giveplayer,leveldiasdaymonthyear,hourminute);
        
VipsLog(string);
        
PlayerInfo[giveid][pVIP] = level;
        
PlayerInfo[giveid][pDays] = gettime()+dias*86400;
        for(new 
0sizeof(VipInfo); i++)
        {
            if(
strcmp(giveplayer,VipInfo[i][vNick],true)==0)
            {
                
VipInfo[i][vTipo] = level;
                return 
SaveVip();
            }
            if(
strcmp("Ninguem",VipInfo[i][vNick],true)==0)
            {
                
VipInfo[i][vTipo] = level;
                return 
SaveVip();
            }
        }
        return 
1;
    }
    return 
0;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)