Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By Elm0P2! :3
- #include <a_samp>
- //SETTINGS
- #define maxgm 100000
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- new gift1rl, gift2rl, gift3rl, g1t, g2t, g3t, moneyfromgift, gift1rtimer, gift2rtimer, gift3rtimer;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Xmas hi!");
- print("--------------------------------------\n");
- gift1rtimer = 0;
- gift2rtimer = 0;
- gift3rtimer = 0;
- CreateObject(19076, 1520.90198, -1713.63379, 12.29951, 0.00000, 0.00000, 315.76364);
- CreateObject(19054, 1522.82361, -1711.22693, 13.13421, 0.00000, 0.00000, 0.00000);
- CreateObject(19054, 1522.82361, -1711.22693, 13.13421, 0.00000, 0.00000, 0.00000);
- CreateObject(19055, 1523.31885, -1713.22461, 13.03749, 0.00000, 0.00000, 0.00000);
- CreateObject(19056, 1521.84973, -1715.16028, 13.21254, 0.00000, 0.00000, 0.00000);
- gift2rl = _:Create3DTextLabel("[GIFT]\n This gift is avaliable", 0x33CCFFAA, 1524.2633,-1713.2318,13.5469, 15.0, 0, 0);
- gift3rl = _:Create3DTextLabel("[GIFT]\n This gift is avaliable", 0x33CCFFAA, 1522.8707,-1710.2765,13.5469, 15.0, 0, 0);
- gift1rl = _:Create3DTextLabel("[GIFT]\n This gift is avaliable", 0x33CCFFAA, 1521.7090,-1716.0947,13.5469, 40.0, 0, 0);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/giftinfo", cmdtext, true, 10) == 0)
- {
- new string[128];
- if(gift1rtimer == 0 && gift2rtimer == 0 && gift3rtimer ==0) return SCM(playerid, -1, "All gifts are ready!!");
- if(gift1rtimer != 0)
- {
- format(string,sizeof string,"Gift 1 will be ready in %d minutes",gift1rtimer);
- SCM(playerid, -1, string);
- }
- if(gift2rtimer != 0)
- {
- format(string,sizeof string,"Gift 2 will be ready in %d minutes",gift2rtimer);
- SCM(playerid, -1, string);
- }
- if(gift3rtimer != 0)
- {
- format(string,sizeof string,"Gift 3 will be ready in %d minutes",gift3rtimer);
- SCM(playerid, -1, string);
- }
- return 1;
- }
- if (strcmp("/opengift", cmdtext, true, 10) == 0)
- {
- moneyfromgift=random(maxgm);
- new string[256];
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1522.82361, -1711.22693, 13.13421))
- {
- if(gift1rtimer != 0) return SCM(playerid, -1, "That gift isnt ready!");
- GivePlayerMoney(playerid, moneyfromgift);
- format(string,sizeof string,"You opened gift and found %d $",moneyfromgift);
- SCM(playerid, -1, string);
- gift1rtimer = 30;
- Update3DTextLabelText(Text3D:gift3rl, 0x33CCFFAA, "[GIFT]\n This gift is not avaliable");
- g1t = SetTimer("GiftTimer1", 60000, true);
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1523.31885, -1713.22461, 13.03749))
- {
- if(gift2rtimer != 0) return SCM(playerid, -1, "That gift isnt ready!");
- format(string,sizeof string,"You opened gift and found %d $",moneyfromgift);
- SCM(playerid, -1, string);
- GivePlayerMoney(playerid, moneyfromgift);
- gift2rtimer = 30;
- Update3DTextLabelText(Text3D:gift2rl, 0x33CCFFAA, "[GIFT]\n This gift is not avaliable");
- g2t = SetTimer("GiftTimer2", 60000, true);
- }
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1521.84973, -1715.16028, 13.21254))
- {
- if(gift3rtimer != 0) return SCM(playerid, -1, "That gift isnt ready!");
- format(string,sizeof string,"You opened gift and found %d $",moneyfromgift);
- SCM(playerid, -1, string);
- GivePlayerMoney(playerid, moneyfromgift);
- gift3rtimer = 30;
- Update3DTextLabelText(Text3D:gift1rl, 0x33CCFFAA, "[GIFT]\n This gift is not avaliable");
- g3t = SetTimer("GiftTimer3", 60000, true);
- }
- return 1;
- }
- if (strcmp("/teleport", cmdtext, true, 10) == 0)
- {
- SetPlayerPos(playerid, 1535.5300,-1713.3191,13.5469);
- SCM(playerid, -1, "Hohoho, Santa teleported you to tree");
- return 1;
- }
- if (strcmp("/resetgifts", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, 0x33CCFFAA, "Only admins!");
- SCMTA(-1, "Admin restarted gifts hurry!");
- Update3DTextLabelText(Text3D:gift3rl,0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- Update3DTextLabelText(Text3D:gift2rl, 0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- Update3DTextLabelText(Text3D:gift1rl, 0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- KillTimer(g1t);
- KillTimer(g2t);
- KillTimer(g3t);
- gift1rtimer = 0, gift2rtimer = 0, gift3rtimer = 0;
- return 1;
- }
- return 0;
- }
- forward GiftTimer1();
- public GiftTimer1()
- {
- if(gift1rtimer == 0)
- {
- KillTimer(g1t);
- Update3DTextLabelText(Text3D:gift3rl,0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- }
- if(gift1rtimer != 0)
- {
- gift1rtimer--;
- }
- }
- forward GiftTimer2();
- public GiftTimer2()
- {
- if(gift1rtimer == 0)
- {
- KillTimer(g2t);
- Update3DTextLabelText(Text3D:gift2rl, 0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- }
- if(gift2rtimer != 0)
- {
- gift2rtimer--;
- }
- }
- forward GiftTimer3();
- public GiftTimer3()
- {
- if(gift3rtimer == 0)
- {
- KillTimer(g3t);
- Update3DTextLabelText(Text3D:gift1rl, 0x33CCFFAA, "[GIFT]\n This gift is avaliable");
- }
- if(gift3rtimer != 0)
- {
- gift3rtimer--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment