[NL] /Explode ID ?? :o
#1

I want a cmd for a admin to explode another player.

/explode ID

Reply
#2

there are some admin FS-es that have this command in it just search for one and copy it out
Reply
#3

in public OnPlayerCommandText :

Код:
if(strcmp(cmd, "/explode", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR, "Use: /explode [id/nick]");
				return 1;
			}
			new playa;
			new Float:x,Float:y,Float:z;
			playa = CheckUser(tmp);
			if(IsPlayerAdmin(playerid))
			{
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
			      GetPlayerPos(playa, x, y, z);
			      format(cmdstring,sizeof(cmdstring),"You explode %s.", PlayerName(playa));
			      format(cmdstring2,sizeof(cmdstring2),"The ADM %s explode you.",PlayerName(playerid));
			      SendClientMessage(playerid,COLOR,cmdstring);
			      SendClientMessage(playa,COLOR,cmdstring2);
			      CreateExplosion(x, y, z, 10, 30);
			      CreateExplosion(x + 1, y, z, 10, 30);
			      CreateExplosion(x + 1, y + 1, z, 10, 30);
			      CreateExplosion(x, y + 1, z, 10, 30);
			      CreateExplosion(x - 1, y, z, 10, 30);
			      CreateExplosion(x, y - 1, z, 10, 30);
			      CreateExplosion(x - 1, y - 1, z, 10, 30);
			      return 1;
					}
					else
					{
					SendClientMessage(playerid, COLOR, "The player is off!");
					return 1;
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR, "You don't are administrator!");
				return 1;
			}
		}
		SendClientMessage(playerid, COLOR, "The Player is off!");
		return 1;
	}
End of the script:
Код:
CheckUser(text[], playerid = INVALID_PLAYER_ID)
{
	new pos = 0;
	while (text[pos] < 0x21)
	{
		if (text[pos] == 0) return INVALID_PLAYER_ID;
		pos++;
	}
	new userid = INVALID_PLAYER_ID;
	if (IsNumeric(text[pos]))
	{
		userid = strval(text[pos]);
		if (userid >=0 && userid < MAX_PLAYERS)
		{
			if(!IsPlayerConnected(userid))
			{
				userid = INVALID_PLAYER_ID;
			}
			else
			{
				return userid;
			}
		}
	}
^^
Reply
#4

C:\Users\Bryan\Desktop\Server\Server LS\gamemodes\penls.pwn(16969) : error 017: undefined symbol "CheckUser"
C:\Users\Bryan\Desktop\Server\Server LS\gamemodes\penls.pwn(16977) : error 017: undefined symbol "cmdstring"
C:\Users\Bryan\Desktop\Server\Server LS\gamemodes\penls.pwn(16977) : error 017: undefined symbol "cmdstring"
C:\Users\Bryan\Desktop\Server\Server LS\gamemodes\penls.pwn(16977) : error 029: invalid expression, assumed zero
C:\Users\Bryan\Desktop\Server\Server LS\gamemodes\penls.pwn(16977) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)