Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Star event made by DiGiTaL AnGeL for Poker
- #define FILTERSCRIPT
- #include <a_samp>
- #define SCM SendClientMessage
- #define SMTA SendClientMessageToAll
- new starevent = 0;
- new starpickup;
- public OnFilterScriptInit()
- {
- print("Star event loaded!");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("Star event unloaded!");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/starevent", true))
- {
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, 0xFF0000FF, "**ERROR** {FFFFFF}You are not an admin!");
- else
- {
- if(starevent == 1) return SCM(playerid, 0xFF000090, "**ERROR** {FFFFFF}The star event si already activated!");
- else if(starevent == 0)
- {
- new Float:X, Float:Y, Float:Z;
- new string[128], name[24];
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerName(playerid, name, 24);
- format(string, 128, "Admin %s started the star event!", name);
- SMTA(0x00FF0080, string);
- starpickup = CreatePickup(1247, 2, X+1, Y+1, Z, 0);
- starevent = 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == starpickup)
- {
- new name[24], string[128];
- GetPlayerName(playerid, name, 24);
- format(string, 128, "%s found the star and won the star event!", name);
- SMTA(0x00FF00FF, string);
- SCM(playerid, 0x00FFFF80, "Congratulations, you've won the star event!");
- GivePlayerMoney(playerid, 700000);
- starevent = 0;
- DestroyPickup(starpickup);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment