Help plz for script
#4

Eject Code

Код:
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,"[ERROR:] You can only eject a user as the driver!");
		      return 1;
		    }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[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_LIGHTYELLOW2, "[ERROR:] You can't eject yourself!"); return 1; }
				    if(IsPlayerInVehicle(playa,test))
				    {
							format(string, sizeof(string), "[INFO:] You have thrown out: %s.", GetPlayerNameEx(playa));
							SendClientMessage(playerid, COLOR_WHITE, string);
							format(string, sizeof(string), "[INFO:] You have been thrown out of the car by: %s.", GetPlayerNameEx(playerid));
							SendClientMessage(playa, COLOR_WHITE, string);
							RemovePlayerFromVehicle(playa);
						}
						else
						{
						  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] That user is not even in your car!");
						  return 1;
						}
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid ID.");
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not in a vehicle!");
			}
		}
		return 1;
	}
and the other one i cant help with you with cause i dont know your script
Reply


Messages In This Thread
Help plz for script - by alban46000 - 05.09.2009, 23:10
Re: Help plz for script - by Eazy_Efolife - 06.09.2009, 00:26
Re: Help plz for script - by alban46000 - 06.09.2009, 01:29
Re: Help plz for script - by Eazy_Efolife - 06.09.2009, 01:30
Re: Help plz for script - by alban46000 - 06.09.2009, 01:54
Re: Help plz for script - by Eazy_Efolife - 06.09.2009, 01:54
Re: Help plz for script - by alban46000 - 06.09.2009, 02:01
Re: Help plz for script - by alban46000 - 06.09.2009, 02:31
Re: Help plz for script - by Eazy_Efolife - 06.09.2009, 02:32
Re: Help plz for script - by alban46000 - 06.09.2009, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)