SA-MP Forums Archive
Vip time. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vip time. (/showthread.php?tid=304166)



Vip time. - budelis - 17.12.2011

Hi visitors. I have one question. I don't know how to do,in my mysql database,when i go look for player,i get how much time left,until he lost vip,i do that succeful,when player connect,and with command,can see how much time left until he lose vip,but i don't know,how to do that in mysql,when i everytime come,time will change.


Re: Vip time. - Kayaque - 17.12.2011

Write it into a variable upon login, and then just show the variable in a string?

pawn Код:
CMD:viptime(playerid, input[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new id;
if(sscanf(input, "u", id)) return SendClientMessage(playerid, color, "use /viptime [id]");

new str[128]; // I know this might be too big, didn't care to count.
new name[MAX_PLAYER_NAME]; GetPlayerName(id, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "Player %s got %d minutes left of his VIP time.", name, VIPtime[id]);
SendClientMessage(playerid, color, str);
return 1;
}



Re: Vip time. - budelis - 17.12.2011

I say in my first post,i have do command. I don't want to go to server,and write that command...I say i want check that in datebase,not in server...


Re: Vip time. - MP2 - 17.12.2011

Have a field in the database that stores how many MINUTES they've played. If they have to play for 60 minutes (an hour) do this:

Time left = 60-minutes_played