Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- /* Skin Dialog
- by
- Private200 */
- //=======================[Colors]====================
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- //=======================[Shortcuts]====================
- #define SCM SendClientMessage
- //=======================[Defines]====================
- new CanChangeSkin[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Skin FS by Private200");
- print("--------------------------------------\n");
- return 1;
- }
- COMMAND:changeskin(playerid, cmdtext[])
- {
- if(!IsPlayerAdmin(playerid)) return SCM(playerid, COLOR_LIGHTBLUE, "You must be an admin to use this command.");
- if(CanChangeSkin[playerid] == 0)
- {
- ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_INPUT, "{33CCFF}Skins", "{FFFFFF}We allow you to change your skin by\n{FFFFFF}typing below the skin ID you want.\n{FF0000}(AVAILABLE ARE FROM 0-299):", "Request", "Close");
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You've changed your skin already in these last 30 minutes. Please wait some more time.");
- return 0;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 5000)
- {
- if(response)
- {
- new skinid, message[64];
- skinid = strval(inputtext);
- if(skinid < 0 || skinid > 299)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "The skin ID entered is not from 0 to 299");
- }
- else
- {
- SetPlayerSkin(playerid, skinid);
- format(message, sizeof(message), "We've provided you with the skin ID %d.", skinid);
- ChangingSkin(playerid);
- SendClientMessage(playerid, 0xFFFFFFFF, message);
- }
- }
- return 1;
- }
- return 0;
- }
- stock ChangingSkin(playerid)
- {
- SetTimer("SkinChangerTimer", 10000, false);
- CanChangeSkin[playerid] = 1;
- return 1;
- }
- forward SkinChangerTimer(playerid);
- public SkinChangerTimer(playerid)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You're now available to change your skin again.");
- CanChangeSkin[playerid] = 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement