Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procure por new PlayerInfo no seu GM e duas linhas antes do };, coloque isto:
- [code]pDays,[/code]
- Lembre-se, também, de fazer o saving e loading da variavel.
- [php]public OnPlayerUpdate(playerid)
- {
- if(PlayerInfo[playerid][pVIP] != 0 && 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(playerid, sStr, 24);
- for(new i = 0; i < sizeof(VipInfo); i++)
- {
- if(strcmp(sStr,VipInfo[i][vNick],true)==0)
- {
- VipInfo[i][vTipo] = 0;
- strmid(VipInfo[i][vNick], "Ninguem", 0, 16, 255);
- return SaveVip();
- }
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmd, "/darvip", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] < 1337)
- return SendClientMessage(playerid, COLOR_GRAD1, "Você não tem autorização para usar esse comando.");
- VipVaga();
- if(!VagaSobrando)
- return SendClientMessage(playerid, COLOR_GRAD1, "Não há mais vagas na lista use /limparvip primeiro.");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
- new giveid = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
- new level = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [nivel] [dias]");
- new dias = strval(tmp);
- GetPlayerName(giveid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(!IsPlayerConnected(giveid) || giveid != INVALID_PLAYER_ID)
- return 1;
- format(string, sizeof string, "Você deu VIP Nível %d para %s por %d dias", level, giveplayer, dias);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof string, "Você ganhou VIP Nível %d por %d dias do admin %s", level, dias, sendername);
- SendClientMessage(giveid, COLOR_LIGHTBLUE, string);
- getdate(year, month, day);
- gettime(hour,minute,second);
- format(string, sizeof(string), "%s deu vip ao %s nível %d por %d dias (%d/%d/%d - %d:%d)",sendername,giveplayer,level, dias, day, month, year,hour, minute);
- VipsLog(string);
- PlayerInfo[giveid][pVIP] = level;
- PlayerInfo[giveid][pDays] = gettime()+dias*86400;
- for(new i = 0; i < sizeof(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;
- }[/php]
Advertisement
Add Comment
Please, Sign In to add comment