Private Messaging [Simple] -
Stanford - 08.02.2013
removed - I have doubt that I really wrote that - it was really time ago, best choice, at least it sounds for me, to delete this and get rid of its reputation points if possible.
Re: Private Messaging [Simple] -
[WA]iRonan - 08.02.2013
Simple but usefull, update is, new code (shorter + the same stuff):
If errors tell me them and i fix it.
Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#define version "1.0"
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" -PM System-");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
new PMEnabled[MAX_PLAYERS];
main()
{
print("\n----------------------------------");
print(" ~PM System~");
print("----------------------------------\n");
}
public OnPlayerConnect(playerid)
{
PMEnabled[playerid] = 1;
return 1;
}
CMD:togpm( playerid, params[ ] )
{
if(isnull(params)) return SendClientMessage(playerid, 0xEDC71CFF, "CMD: /togpm [on/off]");
if(strcmp(params, "on", true ) == 0 )
{
PMEnabled[playerid] = 1;
SendClientMessage(playerid, 0x00FF00FF, "You have enabled your private messaging feature.");
}
else if( strcmp( params, "off", true ) == 0 )
{
PMEnabled[playerid] = 0;
SendClientMessage(playerid, 0xAA3333AA, "You have disabled your private messaging feature");
}
else SendClientMessage(playerid, 0xEDC71CFF,"CMD: /togpm [on/off]");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0 && response == 1)
{
new pName[MAX_PLAYER_NAME],gName[MAX_PLAYER_NAME],string[128];
new giveplayerid = GetPVarInt(playerid,"ClickedPlayer");
GetPlayerName(playerid,pName,sizeof pName);
GetPlayerName(giveplayerid,gName,sizeof gName);
format(string,sizeof string,"{B0B0B0}[PM]{FF0000}From {B0B0B0}%s{FF0000}: {E3BB19}%s",pName,inputtext);
SendClientMessage(giveplayerid,0xFFE615D4,string);
format(string,sizeof string,"{B0B0B0}[PM]{FF0000}Sent to {B0B0B0}%s{FF0000}: {E3BB19}%s",gName,inputtext);
SendClientMessage(playerid,0xFFE615D4,string);
return 1;
}
return 0;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new pName[MAX_PLAYER_NAME], string[170],playerid2;
if(PMEnabled[playerid2] == 0) return SendClientMessage(playerid, 0xAFAFAFAA, "{FF0000}[PM]{AFAFAF}That played has blocked his PMing feature");
SetPVarInt(playerid,"ClickedPlayer",clickedplayerid);
GetPlayerName(clickedplayerid,pName,sizeof(pName));
format(string,sizeof(string),"{FFFFFF}Type message which will be send to {E01B1B}%s{1BB5E0}(%d)",pName,clickedplayerid);
ShowPlayerDialog(playerid,0,DIALOG_STYLE_INPUT,"{FFFFFF}PM",string,"Send","Cancel");
return 1;
}
Re: Private Messaging [Simple] -
Stanford - 08.02.2013
Thanks for making it shorter bro'! I appreciate it
Re: Private Messaging [Simple] -
Alvon - 08.02.2013
That's perfect. Congratulations on your efforts.
Note - You've do well. Nice work.
#March
Re: Private Messaging [Simple] -
[WA]iRonan - 08.02.2013
Quote:
Originally Posted by Edmund_Kavel
Thanks for making it shorter bro'! I appreciate it
|
No problem

, You had unused stuff like OnPlayerSpawn etc...
Re: Private Messaging [Simple] -
Stanford - 08.02.2013
Thanks guys, More filterscripts upcoming!
Re: Private Messaging [Simple] -
theomanking - 08.02.2013
But you coppied it from LuxAdmin! isn't your hardwork!
Re: Private Messaging [Simple] -
Stanford - 08.02.2013
not even from LuxAdmin
Re: Private Messaging [Simple] -
Anak - 08.02.2013
nice work!
Re: Private Messaging [Simple] -
007Skyfall - 08.02.2013
Nice work! I like it. waiting to more Filterscripts