New cmds
#2

Код:
  if(strcmp(cmd, "/bw", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  	{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bw [playerid/PartOfName]");
				return 1;
			}
			new playa;
			playa = ReturnUser(tmp);
			new test;
			test = GetPlayerVehicleID(playerid);
			if(IsPlayerConnected(playa))
			{
  				if(playa != INVALID_PLAYER_ID)
			  {
    				if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "Error!"); return 1; }
			    if(IsPlayerInVehicle(playa,test))
			    {
						new PName[MAX_PLAYER_NAME];
						GetPlayerName(playerid,PName,sizeof(PName));
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GiveNameSpace(PName);
						GiveNameSpace(giveplayer);
						format(string, sizeof(string), "* You broke %s window and thrown him out of the car!", giveplayer);
						SendClientMessage(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "* You have been thrown out the car by %s !", PName);
						SendClientMessage(playa, COLOR_WHITE, string);
						RemovePlayerFromVehicle(playa);
					}
					else
					{
	  				SendClientMessage(playerid, COLOR_GREY, "  That player is not in a vehicle !");
					  return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name!");
				}
			}
		}
		return 1;
	}
Something like that would do it.
Reply


Messages In This Thread
New cmds - by Abraham2nd - 20.06.2010, 23:38
Re: New cmds - by VinceQc - 21.06.2010, 01:31
Re: New cmds - by Abraham2nd - 18.07.2010, 20:17
Re: New cmds - by Dolph - 18.07.2010, 20:18
Re: New cmds - by Abraham2nd - 18.07.2010, 20:19
Re: New cmds - by Kar - 18.07.2010, 20:49
Re: New cmds - by Abraham2nd - 19.07.2010, 00:08
Re: New cmds - by Abraham2nd - 19.07.2010, 19:49

Forum Jump:


Users browsing this thread: 1 Guest(s)