[Ajuda] Ajuda VIP!
#1

oque tem de errado com esse codigo tipo quando relogo aparece que o vip acabou
Quote:

if(strcmp(cmd, "/darvip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [ id ] [level]");
new para1;
new level;
para1 = strval(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1341)
{
if(admadministrando[playerid] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/administrar)");
return 1;
}
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pVIP] = level;
printf("ADMIN CMD: %s has edit %s to a player %d rank.", sendername, giveplayer, level);
format(string, sizeof(string), " O Administrador Mudou Seu Rank De Vip.", level, sendername);
SendClientMessage(para1, COLOR_YELLOW, string);
format(string, sizeof(string), " Voce mudou o Rank De Vip de um Player.", giveplayer,level);
SendClientMessage(playerid, COLOR_YELLOW, string);
new year, month,day;
getdate(year, month, day);
new hour, minute;
gettime(hour,minute);
format(string, sizeof(string), "%s Mudou Rank De Vip de %s ( %d/%d/%d - %d:%d)",sendername,giveplayer,level,year, month, day,hour, minute);
AdminsLog(string);
PlayerInfo[para1][pDiaVIP] = day;
PlayerInfo[para1][pMesVIP] = month;
PlayerInfo[para1][pAnoVIP] = year;
if(PlayerInfo[para1][pMesVIP] > 12)
{
PlayerInfo[para1][pMesVIP] -= 12;
PlayerInfo[para1][pAnoVIP]++;
}
if(PlayerInfo[giveplayerid][pVIP] == 3)
{
PlayerInfo[giveplayerid][pLevel] += 2;
GivePlayerMoneyEx(giveplayerid, 10000000);
return 1;
}
else if(PlayerInfo[giveplayerid][pVIP] == 4)
{
PlayerInfo[giveplayerid][pLevel] += 4;
GivePlayerMoneyEx(giveplayerid, 20000000);
return 1;
}
else if(PlayerInfo[giveplayerid][pVIP] == 5)
{
PlayerInfo[giveplayerid][pLevel] += 6;
GivePlayerMoneyEx(giveplayerid, 30000000);
}
if(PlayerInfo[para1][pMesVIP] > 12)
{
PlayerInfo[para1][pMesVIP] -= 12;
PlayerInfo[para1][pAnoVIP]++;
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "");
}
}
return 1;
}

em OnPlayerLogin
Quote:

new VIPVencido[MAX_PLAYERS];
if(PlayerInfo[playerid][pVIP] >= 1 && PlayerInfo[playerid][pTimeVIP] < 1)
{
VIPVencido[playerid] = 0;
if(month >= PlayerInfo[playerid][pMesVIP] && year >= PlayerInfo[playerid][pAnoVIP])
{
if(day > PlayerInfo[playerid][pDiaVIP]+3)
{
PlayerInfo[playerid][pVIP] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "*SERVER* Seu VIP venceu. Renove seu VIP para ter seu benefinios novamente!");
}
else
{
VIPVencido[playerid] = 1;
}
}
}

Reply
#2

Em OnPlayerLogin, tente isso

pawn Код:
new VIPVencido[MAX_PLAYERS];
if(PlayerInfo[playerid][pVIP] >= 1 && PlayerInfo[playerid][pTimeVIP] < 1)
{
VIPVencido[playerid] = 0;
if(month >= PlayerInfo[playerid][pMesVIP] && year >= PlayerInfo[playerid][pAnoVIP])
{
if(day > PlayerInfo[playerid][pDiaVIP]+3)
{
PlayerInfo[playerid][pVIP] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "*SERVER* Seu VIP venceu. Renove seu VIP para ter seu benefinios novamente!");
return 1;
}
}
else
{
VIPVencido[playerid] = 1;
}
}
}
Reply
#3

nвo resolveu leke '-'
Reply
#4

cara voce nao tem um public que server para guardar os status dos players?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)