Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- //zrob tabele o jakiej kowleik nazwie w bazie danych i wloz tam w kazdy wpisie inny KOD, te 3000 kodow ;)
- public OnPlayerConnect(playerid)
- {
- //zapytanie aby pobieralo date waznosci
- new Year, Month, Day;
- getdate(Year, Month, Day);
- if(ROK_Z_BAZY < Year && MIESIAC_Z_BAZY < Month && DZIEN_Z_BAZY < Day)
- {
- //zabiera premium, najlepiej wyzerowac czas w bazie danych
- }
- //pobieranie z bazy danych info czy jest VIPem, poprostu zrobic pole ze zmienna "ispremium" lub cos w tym stylu
- if(ISPREMIUM_Z_BAZY_DANYCH == 1)
- {
- SetPVarInt(playerid, "Premium", 1);
- SendClientMessage(playerid, 0xFFFFFFFF, "Jesteœ Graczem Premium!");
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/premium", cmdtext, true, 10))
- {
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Premium", "Tu na jaki nr z jaka trescia wyslac SMS wpiszcie!", "Aktywuj", "Anuluj");
- return 1;
- }
- if(!strcmp("/testpcmd", cmdtext, true, 10))
- {
- if(!IsPlayerPremium(playerid))
- {
- //jesli nie jest premium
- return 1;
- }
- //jesli jest premium
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 0)
- {
- //pobieranie all kodow
- if() //jakis KOD wybrany (w petli)
- {
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Premium", "Gratulacje, zosta³eœ graczem premium!", "Ok", "Anuluj");
- SetPVarInt(playerid, "Premium", 1);
- //zapytanie aby zmeinialo czas premium (waznosc) na obecna data + 30 dni
- }
- else
- {
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_INPUT, "Premium", "Kod aktywacji jest niepoprawny!", "Aktywuj", "Anuluj");
- }
- }
- return 1;
- }
- stock IsPlayerPremium(playerid) //funkcja pozwala sprawdzic czy gracz jest VIPem
- {
- if(GetPVarInt(playerid, "Premium") == 1) return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement