13.02.2009, 17:41
I was just wondering how I could go about making a /nopm command. I am not sure how to go about this so if anyone can help me with this I would appreciate it thank you
Originally Posted by harrold
What must the command exactly do?
|
Originally Posted by Daren_Jacobson
disable /pm's i am guessing, but for all or for one person?
|
if(!strcmp("/lsairport", cmdtext, true))
{
DisPm[playerid]=1;
// maby here a message: SendClientMessage
return 1;
}
if(DisPm[recieverid]==1) return SendClientMessage(playerid,COLOR,"This player has disabled his PM"),0;
// At the top of your script somewhere
new NoPM[MAX_PLAYERS];
// In OnPlayerConnect
NoPM[playerid] == 0;
// In OnPlayerCommandText
if(strcmp("/nopm", cmdtext, true) == 0)
{
if(NoPM[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "No PM is now off");
NoPM[playerid] == 0;
return 1;
}
else if(NoPM[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "No PM is now on");
return 1;
}
return 1;
}
// At the bottom of your script somewhere
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
if(NoPM[recieverid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "This player has NO PM turned on, Try again later");
return 1;
}
return 0;
}
Originally Posted by harrold
You have the same as me only i have made mine faster
|