/eject works only with id 0
#8

Place this command to public OnPlayerCommandText in your game mode
Код:
if(strcmp(cmd, "/eject", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
	        new State;
	        if(IsPlayerInAnyVehicle(playerid))
	        {
         		State=GetPlayerState(playerid);
		        if(State!=PLAYER_STATE_DRIVER)
		        {
		        	SendClientMessage(playerid,COLOR_GREY,"   You can only eject people as the driver !");
		            return 1;
		        }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /eject [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, "You cannot Eject yourself!"); return 1; }
				        if(IsPlayerInVehicle(playa,test))
				        {
							new PName[MAX_PLAYER_NAME];
							GetPlayerName(playerid,PName,sizeof(PName));
							GetPlayerName(playa, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* You have thrown %s 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 your Car !");
						    return 1;
						}
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name!");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You need to be in a Vehicle to use this !");
			}
		}
		return 1;
	}
Reply


Messages In This Thread
/eject works only with id 0 - by Face9000 - 01.06.2012, 12:11
Re: /eject works only with id 0 - by ReneG - 01.06.2012, 12:27
Re: /eject works only with id 0 - by Face9000 - 01.06.2012, 12:29
Re: /eject works only with id 0 - by MadeMan - 01.06.2012, 12:31
Re: /eject works only with id 0 - by Face9000 - 01.06.2012, 12:32
Re: /eject works only with id 0 - by JaKe Elite - 01.06.2012, 12:47
Re: /eject works only with id 0 - by Sandiel - 01.06.2012, 13:27
Re: /eject works only with id 0 - by Adrian9696 - 01.06.2012, 13:43
Re: /eject works only with id 0 - by JaKe Elite - 01.06.2012, 13:54

Forum Jump:


Users browsing this thread: 2 Guest(s)