/kill help...
#2

Depending on the script you're using, I can't figure out a way to determine the user is Admin if you don't have a base script.

Код:
if(strcmp(cmd, "/killplayer", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /killplayer [playerid/PartOfName] [reason]");
			return 1;
		}
		giveplayerid = ReturnUser(tmp);
		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				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, "USAGE: /killplayer [playerid/PartOfName] [reason]");
					return 1;
				}
						
					format(string, sizeof(string), "AdmCmd: %s was admin-killed by %s, reason: %s", giveplayer, sendername, (result));
					SendClientMessageToAll(COLOR_LIGHTRED, string);
					SetPlayerHealth(giveplayerid,0.0);


			}
			else
			{
				format(string, sizeof(string), " %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply


Messages In This Thread
/kill help... - by FrazZ - 14.03.2009, 03:50
Re: /kill help... - by Calgon - 14.03.2009, 05:42
Re: /kill help... - by MenaceX^ - 14.03.2009, 10:25
Re: /kill help... - by kc - 14.03.2009, 10:26
Re: /kill help... - by FrazZ - 14.03.2009, 14:59
Re: /kill help... - by FrazZ - 14.03.2009, 15:01
Re: /kill help... - by MenaceX^ - 14.03.2009, 15:02
Re: /kill help... - by Pyrokid - 14.03.2009, 15:09
Re: /kill help... - by FrazZ - 14.03.2009, 15:42
Re: /kill help... - by FrazZ - 14.03.2009, 15:53

Forum Jump:


Users browsing this thread: 6 Guest(s)