PM SYSTEM
#1

fixed
Reply
#2

whats wrong with that? thats how it should be? abit more discription would be helpful for us buddy
Reply
#3

fixed
Reply
#4

Put the admin check under if (!IsPlayerConnected(..)) and return 1; inside of it.
Reply
#5

If you want one of them to show up, depending on whether the sender if an admin or not, you need to make two if statements checking if they're admin or not. Also, the two string sizes don't need to be more than 128 and be sure to include that in the sscanf check as it could return warnings/errors in the server logs.

pawn Код:
CMD:pm(playerid,params[])
{
   new id,msg[128],str2[128];
   if(sscanf(params,"us[128]",id,str2)) return SendClientMessage(playerid,-1,"USAGE: /pm [playerid] [Message]");
   if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Error: That Player Is Not Connected");
   format(msg,sizeof(msg),"PM To %s (ID: %d): %s",pName(id),id,str2);
   SendClientMessage(playerid,0xFF00FFFF,msg);
   if(PlayerInfo[playerid][pAdmin] >= 1)
   {  
       format(msg,sizeof(msg),"PM From Admin %s (ID: %d): %s",pName(playerid),playerid,str2);
       SendClientMessage(id,0xFF00FFFF,msg);
   }
   else
   {
       format(msg,sizeof(msg),"PM From %s (ID: %d): %s",pName(playerid),playerid,str2);
       SendClientMessage(id,0xFF00FFFF,msg);
   }
   return 1;
}
Reply
#6

Try It:
PHP код:
if(sscanf(params,"us[128]"idstr2)) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)