Warnings?
#1

I don't know why. i'm beginner i'm starting to script House System and i take a look at Kwarde tutorial it was cool suddenly it has error. here is the error:

Код:
C:\Documents and Settings\Justin\My Documents\DrivingSchoolExtreme\filterscripts\House.pwn(101) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Justin\My Documents\DrivingSchoolExtreme\filterscripts\House.pwn(235) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Justin\My Documents\DrivingSchoolExtreme\filterscripts\House.pwn(240) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Justin\My Documents\DrivingSchoolExtreme\filterscripts\House.pwn(241) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
codes

pawn Код:
/*

House System
Created by Kwarde
Edit by RobotBox
(2012), Copyright

*/


#include <a_samp>
#include <zcmd>
#include <dini>
#include <streamer>

#pragma unused ret_memcpy
#define MAX_HOUSES 500

/* -------------------------------------------------------------------------- */

enum hInfo
{
    Float:hEnterX,
    Float:hEnterY,
    Float:hEnterZ,
    Float:hExitX,
    Float:hExitY,
    Float:hExitZ,
    hInsideInt,
    hInsideVir,
    hOutsideInt,
    hOutsideVir,
    bool:hOwned,
    hOwner[MAX_PLAYER_NAME],
    hPrice,
    hPickup,
    hIcon,
    hVecModel,
    Float:hVecX,
    Float:hVecY,
    Float:hVecZ,
    Float:hVecA
};
new HouseInfo[MAX_HOUSES][hInfo];
new HouseCar[MAX_HOUSES];
new fstring[300];

/* -------------------------------------------------------------------------- */

forward UpdateHouseInfo();

/* -------------------------------------------------------------------------- */

#define white "{FFFFFF}"
#define red "{FF002B}"
#define pink "{FF00D9}"
#define purple "{DFA7F2}"
#define blue "{A1C2FF}"
#define green "{3DE3B1}"
#define yellow "{FAF623}"
#define black "{69670C}"
#define orange "{F2C80C}"
#define ice "{03F2FF}"
#define lime "{00FF40}"

#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_RED 0xFF0000FF
#define COLOR_PINK 0xFF80FFFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_GREEN 0x008000FF
#define COLOR_LIGHTGREEN 0x00FF00FF
#define COLOR_BLACK 0x000000FF
#define COLOR_BLUE 0x0080FFFF

/* -------------------------------------------------------------------------- */

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n******************************************");
    print("* Beginner House System for Driving School Extreme*");
    print("********************************************\n");
    SetTimer("UpdateHouseInfo", 1000, true);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

public UpdateHouseInfo()
{
    new str[100];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        for(new j = 0; j < MAX_HOUSES; j++)
        {
            if(IsPlayerInRangeOfPoint(j, HouseInfo[j][hEnterX], HouseInfo[j][hEnterY], HouseInfo[j][hEnterZ]) && GetPlayerInterior(i) == HouseInfo[j][hOutsideInt] && GetPlayerVirtualWorld(i) == HouseInfo[j][hOutsideVir]) //<<< i believe that one of the warning was came here.
            {
                if(HouseInfo[j][hOwned])
                {
                    format(str, 100, "~w~House owned by ~r~%s", HouseInfo[j][hOwner]);
                }
                else
                {
                    format(str, 100, "~w~House for sale!~n~Price: ~g~$%d,-", HouseInfo[j][hPrice]);
                    GameTextForPlayer(i, str, 2000, 3);
                }
            }
        }
    }
    return 1;
}

/* Commands */

CMD:buyhouse(playerid, params[])
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
        {
            if(HouseInfo[i][hOwned]) return SendClientMessage(playerid, COLOR_RED, "This house is already sold!");
            if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this house!");
            HouseInfo[i][hOwned] = true;
            strmid(HouseInfo[i][hOwner], pName, 0, false, strlen(pName));
            GivePlayerMoney(playerid, -HouseInfo[i][hPrice]);
            SendClientMessage(playerid, COLOR_GREEN, "House bought!");
            SaveHouse(i);
            LoadHouseVisual(i, true);
            return 1;
        }
    }
    return 1;
}

CMD:sellhouse(playerid, params[])
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
        {
            if(!strcmp(HouseInfo[i][hOwner], pName, false))
            {
                strmid(HouseInfo[i][hOwner], "For Sale", 0, false, 8);
                HouseInfo[i][hOwned] = false;
                GivePlayerMoney(playerid, HouseInfo[i][hPrice]/2);
                SendClientMessage(playerid, COLOR_GREEN, "House sold!");
                SaveHouse(i);
                LoadHouseVisual(i, true);
                return 1;
            }
         }
    }
    return 1;
}

/* Stocks */

stock LoadHouse(houseid)
{
    format(fstring, 10, "ServerFiles/Houses/%d", houseid);
    if(!dini_Exists(fstring)) return 0;
    HouseInfo[houseid][hEnterX] = dini_Float(fstring, "EnterX");
    HouseInfo[houseid][hEnterY] = dini_Float(fstring, "EnterY");
    HouseInfo[houseid][hEnterZ] = dini_Float(fstring, "EnterZ");
    HouseInfo[houseid][hExitX] = dini_Float(fstring, "ExitX");
    HouseInfo[houseid][hExitY] = dini_Float(fstring, "ExitY");
    HouseInfo[houseid][hExitZ] = dini_Float(fstring, "ExitZ");
    HouseInfo[houseid][hInsideInt] = dini_Int(fstring, "InsideInt");
    HouseInfo[houseid][hInsideVir] = dini_Int(fstring, "InsideVir");
    HouseInfo[houseid][hOutsideInt] = dini_Int(fstring, "OutsideInt");
    HouseInfo[houseid][hOUtsideVir] = dini_Int(fstring, "OutsideVir");
    HouseInfo[houseid][hOwned] = dini_Bool(fstring, "Owned") ? true : false;
    strmid(HouseInfo[houseid][hOwner], dini_Get(fstring, "Owner"), 0, false, strlen(dini_Get("Owner")));
    HouseInfo[houseid][hPrice] = dini_Int(fstring, "Price");
    HouseInfo[houseid][hVecModel] = dini_Int(fstring, "HV_Model");
    HouseInfo[houseid][hVecX] = dini_Float(fstring, "HV_PosX");
    HouseInfo[houseid][hVecY] = dini_Float(fstring, "HV_PosZ");
    HouseInfo[houseid][hVecZ] = dini_Float(fstring, "HV_PosZ");
    HouseInfo[houseid][hVecA] = dini_Float(fstring, "HV_PosA");
    return 1;
}

stock LoadHouseVisual(houseid, bool:reload = false)
{
    if(reload)
    {
        DestroyDynamicMapIcon(HouseInfo[houseid][hIcon]);
        DestroyDynamicPickup(HouseInfo[houseid][hPickup]);
        DestroyVehicle(HouseCar[houseid]);
    }
    if(!HouseInfo[houseid][hOwned])
    {
        HouseInfo[houseid][hIcon] = CreateDynamicMapIcon(HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], 31, 0, HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
        HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
    }
    else
    {
        HouseInfo[houseid][hIcon] = CreateDynamicMapIcon(HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], 31, 0, HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
        HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
    }
    if(IsValidVehicleModel(HouseInfo[houseid][hVecModel]))
    HouseCar[houseid] = CreateVehicle(HouseInfo[houseid][hVecModel], HouseInfo[houseid][hVecX], HouseInfo[houseid][hVecY], HouseInfo[houseid][hVecZ], HouseInfo[houseid][hVecA], -1, -1, -1);
    return 1;
}

stock IsValidVehicleModel(vehiclemodel)
{
    if(vehiclemodel >= 400 && vehiclemodel <= 611)
        return true;
    return false;
}

stock SaveHouse(houseid)
{
    dini_FloatSet(fstring, "EnterX", HouseInfo[houseid][hEnterX]);
    dini_FloatSet(fstring, "EnterY", HouseInfo[houseid][hEnterY]);
    dini_FloatSet(fstring, "EnterZ", HouseInfo[houseid][hEnterZ]);
    dini_FloatSet(fstring, "ExitX", HouseInfo[houseid][hExitX]);
    dini_FloatSet(fstring, "ExitY", HouseInfo[houseid][hExitY]);
    dini_FloatSet(fstring, "ExitZ", HouseInfo[houseid][hExitZ]);
    dini_IntSet(fstring, "InsideInt", HouseInfo[houseid][hInsideInt]);
    dini_IntSet(fstring, "InsideVir", HouseInfo[houseid][hInsideVir]);
    dini_IntSet(fstring, "OutsideInt", HouseInfo[houseid][hOutsideInt]);
    dini_IntSet(fstring, "OutsideVir", HouseInfo[houseid][hOutsideVir]);
    dini_BoolSet(fstring, "Owned", HouseInfo[houseid][hOwned]);
    dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]);
    dini_IntSet(fstring, "Price", HouseInfo[houseid][hPrice]);
    dini_IntSet(fstring, "HV_Model", HouseInfo[houseid][hVecModel]);
    dini_FloatSet(fstring, "HV_PosX", HouseInfo[houseid][hVecX]);
    dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecY]);
    dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
    dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)