11.01.2013, 17:40
if you type /dnd
Ppl cannot pming you it's block players from pming
how u make a /dnd
?
Ppl cannot pming you it's block players from pming
how u make a /dnd
?
//top of script
new IsPlayerDND[MAX_PLAYERS];
if(IsPlayerDND[target variable...] == 0)
{
CMD:dnd(playerid,params[])
{
IsPlayerDND[playerid] = 1;
return 1;
}
g_IsDnD[ MAX_PLAYERS ]; //The array is to be to set for individual players
//OnPlayerDisconnect
g_IsDnD[ playerid ] = false;
CMD:dnd(playerid, params[]) //zcmd
{
if( g_IsDnD[ playerid ] )
{
g_IsDnD[ playerid ] = false;
}
else
{
g_IsDnD[ playerid ] = true;
}
return true;
}
//OnPlayerPrivMsg
if( g_IsDnD[ recieverid ] ) //you want to check if the reciever is DnD, not the sender(playerid)
{
return false; //return the callback to not execute more code - make it false to not send the message
}