SA-MP Forums Archive
[HELP] /pm Command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] /pm Command (/showthread.php?tid=216111)



[HELP] /pm Command - >>|Hawks|<< - 24.01.2011

I have this command, but an administrator, type: /pm [ID] [text] indicates text to him, "You must be an administrator that you can use this", but ordinary players can use: /pm [ID] [text]. Can somebody help this command can be used by administrators only, and not the players >> Help please. << >> Sorry for my bad English <<

This is the command:

Код:
if(strcmp(cmd, "/pme", true) == 0 || strcmp(cmd, "/pm", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, SIVA, "   Niste se prijavili!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Komanda: (/p)me [ID Igraca/Dio Imena] [text]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(HidePM[giveplayerid] > 0)
			        {
			            SendClientMessage(playerid, SIVA, "   Taj igrac blokira privatne poruke!");
			            return 1;
			        }
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					if(giveplayerid == playerid)
					{
						format(string, sizeof(string), "* %s brblja nesto sebi.", sendername);
						ProxDetector(5.0, playerid, string, LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA,LJUBICASTA);
					}
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[64];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
					{
						result[idx - offset] = cmdtext[idx];
						idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "Komanda: /pm [IgracevID/DeoImena] [Text]");
						return 1;
					}
					format(string, sizeof(string), "ID:%d %s PM: %s", playerid, sendername, (result));
					SendClientMessage(giveplayerid, 0xBBA033AA, string);
					format(string, sizeof(string), "PM poslan igracu ID:%d | %s: %s", giveplayerid, giveplayer, (result));
					SendClientMessage(playerid,  0xE5C43EAA, string);
					return 1;
				}
			}
			else
			{
					format(string, sizeof(string), "  %d je Offline", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}



Re: [HELP] /pm Command - >>|Hawks|<< - 24.01.2011

Can Somebody help me ?!


Re: [HELP] /pm Command - Cristiano[TW[ - 25.01.2011

I Can help , if you setted language to English