03.11.2013, 01:01
cara ele perguntou o sistema de salvamento... ( dini, DOF2, MySQL, Y_INI, etc... )
new PTVip[MAX_PLAYERS][2]; public OnPlayerConnect(playerid) { new PTAno, PTMes, PTDia; getdate(PTAno, PTMes, PTDia); if(PTVip[playerid][0] != 0) { if(getdate() < PTVip[playerid][1]) if((PTVip[playerid][1] + 30) - PTDiasAno() <= PTDia) { PTVip[playerid][0] = 0; SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!"); } else { if(getdate() - 30 >= PTVip[playerid][1]) PTVip[playerid][0] = 0; SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!"); } } return 1; } CMD:darvip(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vocк nгo й um Admin!"); new GiveID, PVip; if(sscanf(params, "ui", GiveID, PVip)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /darvip [id/nick] [Vip(1-Bronze, 2-Prata e 3-Ouro)]"); if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!"); if(0 >= PVip > 3) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vip somente de 1-3!"); new PTStr[33]; format(PTStr, sizeof(PTStr), "[INFO] Vocк recebeu VIP %s!!", (PVip==1)?("Bronze"):(PVip==2)?("Prata"):("Ouro")); SendClientMessage(GiveID, 0x00FF00FF, PTStr); PTVip[GiveID][1] = getdate(); PTVip[GiveID][0] = PVip; return 1; } CMD:tirarvip(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vocк nгo й um Admin!"); new GiveID; if(sscanf(params, "u", GiveID)) return SendClientMessage(playerid, 0xFFFFFFFF, "[USO] /tirarvip [id/nick]"); if(!IsPlayerConnected(GiveID)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Jogador Offline!"); new PTStr[32]; format(PTStr, sizeof(PTStr), "[INFO] Vocк perdeu VIP %s!!", (PVip==1)?("Bronze"):(PVip==2)?("Prata"):("Ouro")); SendClientMessage(GiveID, 0xFF0000FF, PTStr); PTVip[GiveID][1] = 0; PTVip[GiveID][0] = 0; return 1; } CMD:tempovip(playerid) { if(!PTVip[playerid][0]) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO] Vocк nгo й um VIP!"); new PTStr[45], PTAno, PTMes, PTDia, PTVipDias; getdate(PTAno, PTMes, PTDia); if(getdate() < PTVip[playerid][1]) { if((PTVip[playerid][1] + 30) - PTDiasAno() <= PTDia) { PTVip[playerid][0] = 0; SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!"); } PTVipDias = ((PTVip[playerid][1] + 30) - PTDiasAno()) - PTDia; } else { if(getdate() - 30 >= PTVip[playerid][1]) { PTVip[playerid][0] = 0; SendClientMessage(playerid, 0xFF0000FF, "[INFO] Seu VIP expirou!!"); } PTVipDias = (30 - (getdate() - PTVip[playerid][1])); } format(PTStr, sizeof(PTStr), "[INFO] Restam %d dias para acabar o seu VIP!", PTVipDias); SendClientMessage(playerid, 0x00FF00FF, PTStr); return 1; } stock PTDiasAno() { new PTAno; getdate(PTAno); if(AnoBissexto(PTAno-1)) return 366; return 365; } AnoBissexto(x) return ((!(x % 4) && (x % 100)) || !(x % 400)); // By. [FeK]DraKiNs