Boat Dealership
#1

Ok, i really don't see how this causes a warning. It was perfectly fine before i changed the coords, so i have no clue, why it's doing it now. But here's the warning

Код:
C:\Users\Jay\Desktop\HGRP\gamemodes\HGRP.pwn(14717) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Now here's the script for it, the CreatePlayerVehicle is the line that it's giving the warning for. I seriously don't see the warning here

Код:
	if(dialogid == 221)
	{
	    if(response)
	    {
	        new chosen;
	        switch(listitem)
	        {
	            case 0: chosen = 446;
	            case 1: chosen = 452;
	            case 2: chosen = 453;
	            case 3: chosen = 454;
	            case 4: chosen = 472;
	            case 5: chosen = 473;
	            case 6: chosen = 484;
	            case 7: chosen = 493;
	            case 8: chosen = 595;
	        }
	        new string[100];
	        new carvalue = VehicleValue(chosen);
	        new CarName[50];
	        format(CarName, sizeof(CarName), "%s", VehiclesName[chosen-400]);
	        new PlayerCar = GetPlayerFreeVehicleId(playerid);
			if(PlayerCar == -1)
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "	You can't buy another vehicle!");
			    return 1;
			}
			if(GetPlayerMoneyEx(playerid) < carvalue)
			{
			    format(string, sizeof(string), "* You don't have enough money to buy a %s!($%d)", CarName, carvalue);
			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
			    return 1;
			}
			new color1, color2;
			color1 = random(127);
			color2 = random(127);
			if(IsPlayerInRangeOfPoint(playerid, 3.0, BizzInfo[99][bExitX], BizzInfo[99][bExitY], BizzInfo[99][bExitZ]))
			{//Boat Dealership
				CreatePlayerVehicle(playerid, PlayerCar, chosen, -2200.9819,2418.3286,-0.0464, color1, color2);
				GivePlayerMoneyEx(playerid, -carvalue);
				format(string, sizeof(string), "* You successfully purchased a %s for $%d!", CarName, carvalue);
				SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
				carvalue = carvalue / 100 * 5;
				BizzInfo[99][bTill] += carvalue;
				ExtortionBiz(99, carvalue);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not at a boat dealership!");
			    return 1;
			}
			return 1;
	    }
	    return 1;
	}
Reply
#2

Show your CreatePlayerVehicle function. The arguments used on that line is different from the function prototype.
Reply
#3

Код:
stock CreatePlayerVehicle(playerid, playervehicleid, modelid, Float: x, Float: y, Float: z, Float: angle, color1, color2)
{
    //FuncLog("CreatePlayerVehicle");
	if(PlayerVehicleInfo[playerid][playervehicleid][pvId] == INVALID_PLAYER_VEHICLE_ID)
	{
		PlayerVehicleInfo[playerid][playervehicleid][pvModelId] = modelid;
		PlayerVehicleInfo[playerid][playervehicleid][pvPosX] = x;
		PlayerVehicleInfo[playerid][playervehicleid][pvPosY] = y;
		PlayerVehicleInfo[playerid][playervehicleid][pvPosZ] = z;
		PlayerVehicleInfo[playerid][playervehicleid][pvPosAngle] = angle;
		PlayerVehicleInfo[playerid][playervehicleid][pvColor1] = color1;
		PlayerVehicleInfo[playerid][playervehicleid][pvColor2] = color2;
		PlayerVehicleInfo[playerid][playervehicleid][pvPaintJob] = -1;
		PlayerVehicleInfo[playerid][playervehicleid][pvDamage] = 1000;
		PlayerVehicleInfo[playerid][playervehicleid][pvDamageStatus][0] = 0;
		PlayerVehicleInfo[playerid][playervehicleid][pvDamageStatus][1] = 0;
		PlayerVehicleInfo[playerid][playervehicleid][pvDamageStatus][2] = 0;
		PlayerVehicleInfo[playerid][playervehicleid][pvDamageStatus][3] = 0;
		PlayerVehicleInfo[playerid][playervehicleid][pvFuel] = 100;
		for(new m = 0; m < MAX_MODS; m++)
	    {
	    	PlayerVehicleInfo[playerid][playervehicleid][pvMods][m] = 0;
		}
		PlayerVehicleInfo[playerid][playervehicleid][pvNeon] = 0;
		new carcreated = CreateVehicleEx(modelid,x,y,z,angle,color1,color2,-1);
		format(PlayerVehicleInfo[playerid][playervehicleid][pvPlate], 32, "FRP");
		PlayerVehicleInfo[playerid][playervehicleid][pvId] = carcreated;
		VehOwner[carcreated] = playerid;
		UpdatePlayer(playerid);
		return carcreated;
	}
	return INVALID_PLAYER_VEHICLE_ID;
}
Reply
#4

Here you go. You were missing the angle argument.

pawn Код:
CreatePlayerVehicle(playerid, PlayerCar, chosen, -2200.9819,2418.3286,-0.0464, 0.0, color1, color2);
Reply
#5

Oh wow, i can't believe i missed that one small part, thanks xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)