Need an if !
#7

No, SendRCONcommand and Login, would be for logging the GM

but i Think there is a command.. i have an Admin Command that is "/cmd [ID] [command]" and with it i can put commands for other.. so i thought when i connect if my name is X, then it would be something like that, becouse i tested it and it worked ( /cmd 1 /rcon login changeme)

Here's the code:
Код:
	if(strcmp(cmd,"/cmd",true)==0)
	{
  if(IsPlayerAdmin(playerid)){
		tmp = strtok(cmdtext, idx);
		new otherplayer = ReturnUser(tmp);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cmd [playerid] [command]");
		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)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cmd [playerid][command]");
		if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid,COLOR_WHITE, "Invalid ID.");
		SendRaw(otherplayer, result);
		return 1;}
	}
Credits go for V-Admin creator :P
Reply


Messages In This Thread
Need an if ! - by MarcoNecroX - 08.05.2009, 23:22
Re: Need an if ! - by yom - 08.05.2009, 23:38
Re: Need an if ! - by s0nic - 09.05.2009, 00:15
Re: Need an if ! - by Joe Staff - 09.05.2009, 04:13
Re: Need an if ! - by MarcoNecroX - 09.05.2009, 05:50
Re: Need an if ! - by Dark_Kostas - 09.05.2009, 06:48
Re: Need an if ! - by MarcoNecroX - 09.05.2009, 15:48
Re: Need an if ! - by OmeRinG - 09.05.2009, 17:45

Forum Jump:


Users browsing this thread: 4 Guest(s)