New cmds
#1

ok i would like to know how to add a /bw [id] (Break Window) cmd to cops so that when a cop is close to wanted player he can break window and pull him out ...and also a /mod command for lvl 4 admins and up to tune a car and customize it TY
Reply
#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
#3

erm under what should i put it? thx for help
Reply
#4

OnPlayerCommandText..
Reply
#5

ok ill try.. ty
Reply
#6

Quote:
Originally Posted by Abraham2nd
Посмотреть сообщение
ok ill try.. ty
gj on the biggest bump ever
Reply
#7

whats that suppose to mean...
Reply
#8

i get loads of error when added to gamemode...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)