[NL] /Explode ID ?? :o
#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


Messages In This Thread
[NL] /Explode ID ?? :o - by Jokerr_mayne - 18.05.2009, 19:08
Re: [NL] /Explode ID ?? :o - by MPKaboose - 18.05.2009, 19:10
Re: [NL] /Explode ID ?? :o - by Xeretta - 18.05.2009, 19:24
Re: [NL] /Explode ID ?? :o - by superbryanb - 13.06.2009, 12:23

Forum Jump:


Users browsing this thread: 1 Guest(s)