SA-MP Forums Archive
PM SYSTEM - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PM SYSTEM (/showthread.php?tid=610507)



PM SYSTEM - Loinal - 24.06.2016

fixed


Re: PM SYSTEM - CSLangdale - 24.06.2016

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


Re: PM SYSTEM - Loinal - 24.06.2016

fixed


Re: PM SYSTEM - Stinged - 24.06.2016

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


Re: PM SYSTEM - DTV - 25.06.2016

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;
}



Re: PM SYSTEM - moura98 - 25.06.2016

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