/trunkinfo help
#1

Код:
CMD:trunkinfo(playerid, params[]) {
	if(IsPlayerInAnyVehicle(playerid)) {
		SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while you're inside a vehicle.");
	}
	else if(GetPVarInt(playerid, "IsInArena") >= 0) {
		return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
	}
	else if(GetPVarInt( playerid, "EventToken") != 0) {
		return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this while you're in an event.");
	}
	//else if(PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) {
		//return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are limited from using weapons for your first 2 hours of gameplay.");
	//}

	new
		Float: fVehPos[3];

	for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++) {
		if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) {
			GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
			if(IsPlayerInRangeOfPoint(playerid, 8.0, fVehPos[0], fVehPos[1], fVehPos[2])) {
				if(isnull(params)) {

					new
						szMessage[64 + MAX_PLAYER_NAME];

					format(szMessage, sizeof(szMessage), "*** %s's %s Safe ***", GetPlayerNameEx(playerid), GetVehicleName(PlayerVehicleInfo[playerid][d][pvId]));
					SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
					for(new s = 0; s < 3; s++) if(PlayerVehicleInfo[playerid][d][pvWeapons][s] != 0) {

						new
							szWeapon[16];

						GetWeaponName(PlayerVehicleInfo[playerid][d][pvWeapons][s], szWeapon, sizeof(szWeapon));
						format(szMessage, sizeof(szMessage), "Slot %d: %s, Ammo: %d", s+1, szWeapon, PlayerVehicleInfo[playerid][d][pvWepAmmo][s]);
						SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
					}
					format(szMessage, sizeof(szMessage), "* %s peers into their car trunk, inspecting the items.", GetPlayerNameEx(playerid));
					ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				}
			}
			else
			{
				Error(playerid, "You aren't near a vehicle.");
			}
		}
	}
	return 1;
}
I want to make this, you can use /trunkinfo if the vehicle's trunk is open even you don't own the vehicle.
Reply
#2

Create a variable which declare the trunk "open".

Like "TrunkOpened[MAX_VEHICLES] = false;"

Set it as "true" when you open your trunk.

Allows players to use /trunkinfo if the trunk is open.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)