Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <Colors>
- #include <zcmd>
- #include <dini>
- #pragma tabsize 0
- #define JoinFile "Join.ini"
- #define LeaveFile "Leave.ini"
- /*
- me - for creating this script, and for color include
- Zeex for zcmd
- Dracoblue for dini
- sa-mpteam - for all sa-mp functions and callback
- */
- /*
- This is a simple FIlterscript, JoinLeaveCreater with this you can create your own JoinLeave message
- Why to create this? : to be honest that was a ideea , but now i don't think so this will be soo usefull,
- Script created by XSTORMIEST
- */
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Free In-Game Converter Online");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid,cmdtext[])
- {
- return 1;
- }
- CMD:jlmsg(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"This cmd is only for owner!!");
- else ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"Join Leave Creator", "Join Message\nLeave Message","Select","Cancel");
- return 1;
- }
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- if(dialogid == 47)
- {
- if(!response) return 1;
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,56,DIALOG_STYLE_INPUT,"Join Message","Please write the text you want to writee.! please use format %s for your text:\nExample: Welcome , %s joined to the server","Create","Cancel");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,57,DIALOG_STYLE_INPUT,"Leave Message","Please write the text you want to writee.! please use format %s for your text:\nExample: %s had left the server","Next","Cancel");
- }
- }
- }
- if(dialogid == 56)
- {
- if(!response) return 1;
- if(response)
- {
- new name[MAX_PLAYER_NAME], string[256];
- format(string,sizeof(string), "Add this under OnPlayerConnect(playerid): =>>\r\nnew name[MAX_PLAYER_NAE], string[256];\r\nGetPlayerName(playerid,name,sizef(name));\r\nformat(string,sizeof(string),'%s',name);\r\nSendClientMessage(playerid,-1,string); ",inputtext[0],name[0]);
- new File: file;
- file = fopen(JoinFile,io_append);
- if(file)
- {
- fwrite(file,string);
- fclose(file);
- }
- SendClientMessage(playerid,COLOR_YELLOW,"File created! check scriptfile at Join.ini");
- }
- }
- if(dialogid == 57)
- {
- new name[MAX_PLAYER_NAME], string[256];
- GetPlayerName(playerid,name,sizeof(name));
- format(string,sizeof(string),"Add this under OnPlayerDisconnect(playerid,reason)\r\nnew name[MAX_PLAYER_NAME],string[256]\r\nGetPlayerName(playerid,name,sizeof(name));\r\nformat(string,sizzeof(string),'%s',name);\r\nSendClientMessage(playerid,-1,string);",inputtext[0]);
- new File: file;
- file = fopen(LeaveFile,io_append);
- if(file)
- {
- fwrite(file,string);
- fclose(file);
- }
- SendClientMessage(playerid,COLOR_YELLOW,"File created! check scriptfile at Leave.ini");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement