Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Short FilterScript by Tanush
- Server IP: 213.5.176.159:7789
- Special thanks to Zeex (ZCMD)
- Another thanks to Y_Less (sscanf)
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];
- public OnPlayerConnect(playerid)
- {
- togglepm[playerid] = 1;
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- if(sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xFF9900AA,"USAGE: /pm [ID] [message]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"That user is not connected.");
- if(togglepm[ID] == 0) return SendClientMessage(playerid,0xff0000ff,"ERROR: That user has is pm to toggle off");
- GetPlayerName(ID,Pname,sizeof(Pname));
- GetPlayerName(playerid,Nam,sizeof(Nam));
- format(str,sizeof(str),"You had send a message to %s",Pname);
- SendClientMessage(playerid,0xFF9900AA,str);
- format(str,sizeof(str),"%s Send you a PM: %s",Nam,message);
- SendClientMessage(ID,0xFF9900AA,str);
- return 1;
- }
- CMD:togglepm(playerid,params[])
- {
- if(togglepm[playerid] == 1)
- {
- SendClientMessage(playerid,0xff9900aa,"You had toggled your pm to off now, you won't get pm's.");
- togglepm[playerid] = 0;
- }
- else if(togglepm[playerid] == 0)
- {
- SendClientMessage(playerid,0xff9900aa,"You had toggled your pm to on now, you will get pm's from others.");
- togglepm[playerid] = 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement