CMD:mshop(playerid, params[]) { ShowPlayerDialog(playerid, DIALOG_mshop, DIALOG_STYLE_LIST, ""COL_YELLOW"Mshop","Buy VIP For 30 Days (30 Mcoin)\nBuy VIP For 7 Days (7 Mcoin)", "Buy", "Cancel"); return 1; }
if(dialogid == DIALOG_mshop) { if(response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][mcoin] < 30) return SendClientMessage(playerid, -1, "You Dont Have Enough Mcoin Plss Buy It!"); PlayerInfo[playerid][mcoin] -= 30; PlayerInfo[playerid][VipLevel] = 1; PlayerInfo[playerid][VipTime] +=gettime()+2592000; new string1[90], tname[MAX_PLAYER_NAME], string2[90], file[300]; GetPlayerName(playerid, tname, sizeof(tname)); format(file,sizeof(file),"nAdmin/Users/%s.ini",tname); dini_IntSet(file,"VipLevel",1); dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipLevel]); GetPlayerName(playerid, aname, sizeof(aname)); format(string1, sizeof(string1), "%s has Buy Level 1 VIP for 30 days from /mshop", tname); SendClientMessageToAll(COLOR_GREEN, string1); GameTextForPlayer(playerid, "Congratulations!", 2000, 5); SendClientMessage(playerid, -1, "You Have Buy VIP Level 1 For 30 Mcoin for 30 Days from /mshop"); } case 1: { if(PlayerInfo[playerid][mcoin] < 7) return SendClientMessage(playerid, -1, "You Dont Have Enough Mcoin Plss Buy It!"); PlayerInfo[playerid][mcoin] -= 7; PlayerInfo[playerid][VipLevel] = 1; PlayerInfo[playerid][VipTime] +=gettime()+604800; new string1[90], tname[MAX_PLAYER_NAME], string2[90], file[300]; GetPlayerName(playerid, tname, sizeof(tname)); format(file,sizeof(file),"nAdmin/Users/%s.ini",tname); dini_IntSet(file,"VipLevel",1); dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipLevel]); GetPlayerName(playerid, aname, sizeof(aname)); format(string1, sizeof(string1), "%s has Buy Level 1 VIP for 7 days from /mshop", tname); SendClientMessageToAll(COLOR_GREEN, string1); GameTextForPlayer(playerid, "Congratulations!", 2000, 5); SendClientMessage(playerid, -1, "You Have Buy VIP Level 1 For 7 Mcoin for 7 Days from /mshop"); } } } }
if(gettime() > PlayerInfo[playerid][VipTime]) { PlayerInfo[playerid][VipLevel] = 0; }
PlayerInfo[playerid][VipTime] -= gettime();
if(dialogid == DIALOG_mshop) { if(response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][mcoin] < 30) return SendClientMessage(playerid, -1, "You Dont Have Enough Mcoin Plss Buy It!"); PlayerInfo[playerid][mcoin] -= 30; PlayerInfo[playerid][VipLevel] = 1; PlayerInfo[playerid][VipTime] +=gettime()+2592000; new string1[90], tname[MAX_PLAYER_NAME], string2[90], file[300]; GetPlayerName(playerid, tname, sizeof(tname)); format(file,sizeof(file),"nAdmin/Users/%s.ini",tname); dini_IntSet(file,"VipLevel",1); dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipLevel]); set it // dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipTime]); GetPlayerName(playerid, aname, sizeof(aname)); format(string1, sizeof(string1), "%s has Buy Level 1 VIP for 30 days from /mshop", tname); SendClientMessageToAll(COLOR_GREEN, string1); GameTextForPlayer(playerid, "Congratulations!", 2000, 5); SendClientMessage(playerid, -1, "You Have Buy VIP Level 1 For 30 Mcoin for 30 Days from /mshop"); } case 1: { if(PlayerInfo[playerid][mcoin] < 7) return SendClientMessage(playerid, -1, "You Dont Have Enough Mcoin Plss Buy It!"); PlayerInfo[playerid][mcoin] -= 7; PlayerInfo[playerid][VipLevel] = 1; PlayerInfo[playerid][VipTime] +=gettime()+604800; new string1[90], tname[MAX_PLAYER_NAME], string2[90], file[300]; GetPlayerName(playerid, tname, sizeof(tname)); format(file,sizeof(file),"nAdmin/Users/%s.ini",tname); dini_IntSet(file,"VipLevel",1); dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipLevel]); set it // dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipTime]); GetPlayerName(playerid, aname, sizeof(aname)); format(string1, sizeof(string1), "%s has Buy Level 1 VIP for 7 days from /mshop", tname); SendClientMessageToAll(COLOR_GREEN, string1); GameTextForPlayer(playerid, "Congratulations!", 2000, 5); SendClientMessage(playerid, -1, "You Have Buy VIP Level 1 For 7 Mcoin for 7 Days from /mshop"); } } } }
PlayerInfo[playerid][VipTime] += gettime()+2592000; then i use dini_IntSet(file,"VipTime", PlayerInfo[playerid][VipLevel]); |
PlayerInfo[playerid][VipTime] =gettime()+2592000;
...
PlayerInfo[playerid][VipTime] =gettime()+604800;
PlayerInfo[playerid][VipTime] -= gettime();