All pastes #374274 Raw Edit

Miscellany

public text v1 · immutable
#374274 ·published 2007-02-27 13:12 UTC
rendered paste body
	if(strcmp(cmdtext,"/kickp",true)==0){
	new string[256];
	new vehicleid;
	new vcount;
	new playerstate = GetPlayerState(playerid);
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	if(!IsPlayerInAnyVehicle(playerid)){
	SendClientMessage(playerid,COLOR_RED,"You are not in a vehicle");
	return 1;
	}
	if(playerstate == PLAYER_STATE_PASSENGER){
	SendClientMessage(playerid,COLOR_RED,"Passengers can't use This!");
	return 1;
	}
	vehicleid = GetPlayerVehicleID(playerid);
	for(new i=0;i<MAX_PLAYERS;i++){
	if(IsPlayerConnected(playerid)){
	if(IsPlayerInVehicle(i,vehicleid) && i != playerid){
	vcount++;
	RemovePlayerFromVehicle(i);
	format(string,sizeof(string),"You have been kicked from %s's Vehicle",playername);
	SendClientMessage(i,COLOR_RED,string);
	}
	}
	}
	if(vcount == 0){
	SendClientMessage(playerid,COLOR_RED,"There are no passengers in your vehicle");
	return 1;
	}
	return 1;
	}