Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #if defined FILTERSCRIPT
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/cactivate", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{00FF00}Please enter activation code:", "Enter", "Cancel");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 12)
- {
- if(!response) return 0;
- if(!strlen(inputtext)) ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{00FF00}Please enter activation code: (letter case sensivity)", "Enter", "Cancel");
- if(response)
- {
- new Str[128];
- format(Str, sizeof(Str), "%s", inputtext);
- if(!strcmp(inputtext, Str, false))
- {
- new Str2[128];
- format(Str2, sizeof(Str2), "Codes/%s.txt", inputtext);
- if(fexist(Str2))
- {
- GivePlayerMoney(playerid, 5000000);
- PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
- new Str3[128];
- format(Str3, sizeof(Str3), "{FFFFFF}Code: {00FF00}%s {FFFF00}activated {00FF00}succesfully {FF0000}this code cannot be used anymore!", inputtext);
- SendClientMessage(playerid, 0xFFFFFFFF, Str3);
- fremove(Str2);
- }
- else
- {
- ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{FF0000}The code youve entered is either wrong either used allready! try again.", "Enter", "Cancel");
- }
- }
- }
- }
- return 1;
- }
- //By UltraScripter//////////////////////////////////////////////////////
- //By UltraScripter//////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement