warning 209: function "cmd_park2" should return a value
#1

Код:
C:\Users\user\Desktop\SAMP\San Andreas Life Roleplay\gamemodes\SAL-RP_script.PWN(61159) : warning 209: function "cmd_park2" should return a value
Код:
CMD:park2(playerid, params[])
{
    new amount = GetPlayerCash(playerid);
    new carid = GetPlayerVehicleID(playerid);
    if(amount < 300) return SendClientMessageEx(playerid, COLOR_BRIGHTRED, "[ERROR]: {FFFFFF}You don't have enough money to park, parking cost 300$.");
	if(!carid) return SendClientMessageEx(playerid, COLOR_BRIGHTRED, "[ERROR]: {FFFFFF}You must be inside your vehicle.");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_BRIGHTRED, "[ERROR]: {FFFFFF}You must be the driver!");
	for(new d = 0; d < MAX_PLAYERVEHICLES; d++)
	{
		if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId]))
		{
			static g_arrDamage[4];
			new Float:x, Float:y, Float:z, Float:angle, Float:health, Float:fuel;
		 	fuel = Gas[carid];
			GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
			if(PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
			GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
			GetVehicleZAngle(PlayerVehicleInfo[playerid][d][pvId], angle);
			GetVehicleDamageStatus(PlayerVehicleInfo[playerid][d][pvId], g_arrDamage[0], g_arrDamage[1], g_arrDamage[2], g_arrDamage[3]);
			SurfingCheck(GetPlayerVehicleID(playerid));
			UpdatePlayerVehicleParkPosition(playerid, d, x, y, z, angle, health, fuel);
			PutPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], 0);
			SetPlayerArmedWeapon(playerid, 0);
			new string[30 + (MAX_PLAYER_NAME * 2)];
			format(string, sizeof(string), "** %s has parked their vehicle.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			GivePlayerCash(playerid, -300);
			return 1;
		}
			SendClientMessageEx(playerid, COLOR_GRAD1, "You need to be in your own vehicle.");
		}
	}
	return 1;
}
Reply
#2

fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)