[Ajuda] Por que toda vez que eu relogo minha VIP й removida?
#1

What is worng with my VIP system? Everytime I relog say:
"Your VIP expired!"

O que tem de errado com meu VIP system? Toda vez que eu relogo entra em:
"Sua VIP expirou!"

ADD VIP FUNC
Код:
stock AddVIP(playerid, days, price) {
	if(DP[playerid] < price) {
		new string[50];
		format(string, sizeof(string), "You do not have %i Donate Points", price );
		SendClientMessage(playerid, COLOR_LIGHTRED, string);
	}
	else {
		DP[playerid] -= price;
		VIP[playerid] = 1;
	    if(expirarVIP[playerid] > 0) { expirarVIP[playerid] += (days * 86400); } // already have VIP
	    else { expirarVIP[playerid] = gettime() + (days * 86400); } // dont have VIP
	}
}
Check VIP acabou
Код:
			if(gettime() < expirarVIP[playerid]) {
				if(idiom[playerid] == 1) {  SendClientMessage(playerid, COLOR_LIGHTRED, "Sua VIP expirou!"); }
				else if(idiom[playerid] == 2) {  SendClientMessage(playerid, COLOR_LIGHTRED, "Your VIP expired!"); }
				VIP[playerid] = 0;
				expirarVIP[playerid] = 0;
			}
Estou carregando e salvando direito (eu acho)....
Serб que o problema й no tamanho da variavel por ser int?
Код:
21	expirarVIP	int(10)
save
Код:
    mysql_format(ConnectMYSQL, query, sizeof(query), "UPDATE `accounts` SET `DP` = '%d', `VIP` = '%d', `fmembro` = '%d', `preso` = '%d', `presotime` = '%d', `expirarVIP` = '%d', `carid` = '%d', `playerlskin` = '%d', `job` = '%d', `org` = '%d', `carpos0` = '%f', `carpos1` = '%f', `carpos2` = '%f', `carpos3` = '%f', `playerlpos0` = '%f', `playerlpos1` = '%f', `playerlpos2` = '%f', `playerlpos3` = '%f' WHERE Username = '%s'",
    DP[playerid],
    VIP[playerid],
    fmembro[playerid],
    preso[playerid],
    presotime[playerid],
    expirarVIP[playerid],
    carid[playerid],
	playerlskin[playerid],
	job[playerid],
	org[playerid],
    carpos[playerid][0],
    carpos[playerid][1],
    carpos[playerid][2],
    carpos[playerid][3],
    playerlpos[playerid][0],
    playerlpos[playerid][1],
    playerlpos[playerid][2],
    playerlpos[playerid][3],
    GetName(playerid));
    mysql_pquery(ConnectMYSQL, query);
load
Код:
stock OnPlayerLogin(playerid) {
    new query[512], rows, fields;
	mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Username` = '%s'", Nome(playerid) );
	mysql_query(ConnectMYSQL,query);
    cache_get_data(rows, fields);
    if(rows) {
		new int_dest[85];
		...
		int_dest[15] = cache_get_field_content_int(0, "expirarVIP");     		expirarVIP[playerid] = int_dest[15];
...
Reply
#2

mude para este !
PHP код:
if(expirarVIP[playerid] < gettime()) {
                if(
idiom[playerid] == 1) {  SendClientMessage(playeridCOLOR_LIGHTRED"Sua VIP expirou!"); }
                else if(
idiom[playerid] == 2) {  SendClientMessage(playeridCOLOR_LIGHTRED"Your VIP expired!"); }
                
VIP[playerid] = 0;
                
expirarVIP[playerid] = 0;
            } 
Reply
#3

Quote:
Originally Posted by Glederson_dom
Посмотреть сообщение
mude para este !
PHP код:
if(expirarVIP[playerid] < gettime()) {
                if(
idiom[playerid] == 1) {  SendClientMessage(playeridCOLOR_LIGHTRED"Sua VIP expirou!"); }
                else if(
idiom[playerid] == 2) {  SendClientMessage(playeridCOLOR_LIGHTRED"Your VIP expired!"); }
                
VIP[playerid] = 0;
                
expirarVIP[playerid] = 0;
            } 
Acho q pegou, vlw +Rep
Reply


Forum Jump:


Users browsing this thread: