26 Pawn Errors ...
#1

Hello, I wanted to make a House System on my server and I started to read this Tut: https://sampforum.blast.hk/showthread.php?tid=179206

But when I finished, and tried to complie i was given these errors:
Код:
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(90) : error 017: undefined symbol "IsValidVehicleModel"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(93) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(93) : error 017: undefined symbol "IsValidVehicleModel"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(95) : error 017: undefined symbol "vehiclemodel"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(100) : warning 225: unreachable code
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(100) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(100) : error 017: undefined symbol "SaveHouse"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(103) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(104) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(105) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(106) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(107) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(108) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(109) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(110) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(111) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(112) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(113) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(114) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(115) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(116) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(117) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(118) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(119) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(120) : error 017: undefined symbol "fstring"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(122) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(122) : error 004: function "OnPlayerKeyStateChange" is not implemented

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
How can someone help me
Reply
#2

Most likely you missed a bracket or something like that
Reply
#3

Post ur code also...
Reply
#4

wait, the crystal ball is telling me what is your code
Reply
#5

My lines are:
pawn Код:
#include <a_samp>
#include <Dini>
#include <streamer>

#define MAX_HOUSES 200

#define COLOR_WHITE 0xFFFFFFAA //White color
#define COLOR_RED 0xFF0000AA //Red Color
#define COLOR_GREEN 0x00FF00AA //Green color

enum hInfo
{
    Float:hEnterX, //Entrance X. It's an float! example: 0.0000000. I'm gonna use the same with the other entrances/exits
    Float:hEnterY,
    Float:hEnterZ,
    Float:hExitX,
    Float:hExitY,
    Float:hExitZ,
    hInsideInt, //The inside interior.. DUH!
    hInsideVir, //Already subscribed above
    hOutsideInt,
    hOutsideVir,
    bool:hOwned, //boolean! Is house owned? NO = False, YES = True
    hOwner[MAX_PLAYER_NAME], //The house owner! I'm gonna use MAX_PLAYER_NAME, because a player can't have a longer name :')
    hPrice, //Will store the price
    hPickup, //The pickup. This is used to remove/move the pickup icon!
    hIcon, //The map icon. Also used to remove/move it! We are going to need an ID. Without an ID we can't do NOTHING!
    hVecModel, //The housecar's model
    Float:hVecX, //X location. En float too.
    Float:hVecY,
    Float:hVecZ,
    Float:hVecA
};

new HouseInfo[MAX_HOUSES][hInfo];
new HouseCar[MAX_HOUSES];

stock LoadHouse(houseid)
{

new fstring[10]; //The string for the file [format]
format(fstring, 10, "Houses/%d", houseid); //Format the filename
if(!dini_Exists(fstring)) return 0; //"If Houses/{houseid} not exists then return False (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; //Because it is an boolean: ? true : false;
strmid(HouseInfo[houseid][hOwner], dini_Get(fstring, "Owner"), 0, false, strlen(dini_Get("Owner"))); //Used this one instead of {string} = {string}. I've ever read that this is faster
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]) //Also known as 'if(HouseInfo[houseid][hOwned] == false)' - With aan boolean you can use '!{option}' and "{option}"! (!IsPlayerAdmin())) (IsPlayerAdmin())
{
    //So the house is not owned. Let's make an green mapicon and en green house pickup!
    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
{
    //House is already owned. Blue pickup and red icon!
    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])) //Is the vehicle model valid? In the range of 400-611? Function below
    HouseCar[houseid] = CreateVehicle(HouseInfo[houseid][hVecModel], HouseInfo[houseid][hVecX], HouseInfo[houseid][hVecY], HouseInfo[houseid][hVecZ], HouseInfo[houseid][hVecA], -1, -1, -1); //Color1 -1, Color2 -1, -1 respawn (only respawn with function or on vehicle death)

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]); //No, not "GetSet"! :P
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]);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid)) //If player pressed ENTER_VEHICLe and if he's not in an vehicle
    {
        for(new i = 0; i < MAX_HOUSES; i++) //Loop through all the houses
        {
            if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world
            {
                SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
                SetPlayerInterior(playerid, HouseInfo[i][hInsideInt]);
                SetPlayerVirtualWorld(playerid, HouseInfo[i][hInsideVir]);
                //This will put the player IN the house
            }
            else if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hInsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hInsideVir]) //Same as the previous IsPlayerInRangeOfPoint, but now if the player is near the house exit+int+vir
            {
                SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
                SetPlayerInterior(playerid, HouseInfo[i][hOutsideInt]);
                SetPlayerVirtualWorld(playerid, HouseInfo[i][hOutsideVir]);
            }
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("UpdatePlayersHouseInfo", 1000, true); //Every 1000 milli seconds (1 sec.) it will be used again
    return 1;
}

public UpdatePlayersHouseInfo()
{
    new str[100]; //The string we are gonna format
    for(new i = 0; i < MAX_PLAYERS; i++) //Loop through all the players
    {
        for(new j = 0; j < MAX_HOUSES; j++) //Loop through all the houses
        {
            if(IsPlayerInRangeOfPoint(j, HouseInfo[j][hEnterX], HouseInfo[j][hEnterY], HouseInfo[j][hEnterZ]) && GetPlayerInterior(i) == HouseInfo[j][hOutsideInt] && GetPlayerVirtualWorld(i) == HouseInfo[j][hOutsideVir]) //You already know this! If you don't know it, do step 3 again!
            {
                if(HouseInfo[j][hOwned]) //Is house owned?
                    format(str, 100, "~w~House owned by ~r~%s", HouseInfo[j][hOwner]); //Will give: {white_color}House owned by {yellow_color}OWNER
                else //House isn't owned
                    format(str, 100, "~w~House for sale!~n~Price: ~g~$%d,-", HouseInfo[j][hPrice]); //Will give: {white_color}House for sale!{new line}Price: {green_color}$PRICE
                GameTextForPlayer(i, str, 2000, 3); //Show the text 2 seconds!
            }
         }
    }
    return 1;
}

if(!strcmp(cmdtext, "/buyhouse", true))
{
    new pName[MAX_PLAYER_NAME]; //For the player's name - For the house
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //Get the name of the player and store it in pName
    for(new i = 0; i < MAX_HOUSES; i++) //Last time I'm gonna say it: Loop through all the houses
    {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world (Last time I said this too!)
        {
            if(HouseInfo[i][hOwned]) return SendClientMessage(playerid, COLOR_RED, "This house is already owned!"); //Is the house owned? Then send message that it's owned and stop.
            if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money for this!"); //Has player too less money? Send him a message!

            HouseInfo[i][hOwned] = true; //The house is owned, where the player used /buyhouse
            strmid(HouseInfo[i][hOwner], pName, 0, false, strlen(pName)); //Put the players name into the "hOwner" of the house
            GivePlayerMoney(playerid, -HouseInfo[i][hPrice]); //Remove some money of the player.. The value of the house
            SendClientMessage(playerid, COLOR_GREEN, "House bought!"); //Send the player an message.
            SaveHouse(i);
            LoadHouseVisual(i, true); //Load House Visual. Now, I've added ', true': It will RELOAD now!
            return 1;
        }
    }
    return 1;
}

if(!strcmp(cmdtext, "/sellhouse", true))
{
    new pName[MAX_PLAYER_NAME]; //See /buyhouse
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //See new 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)) //Is the owner of the house the same as the players name (is the player the owner?? !)
            {
                strmid(HouseInfo[i][hOwner], "For Sale", 0, false, 8); //Set the owner of the house to "For Sale"
                HouseInfo[i][hOwned] = false; //House is not owner anymore!
                GivePlayerMoney(playerid, HouseInfo[i][hPrice]/2); //Give the player 50% of the house value back!
                SendClientMessage(playerid, COLOR_GREEN, "House sold!");
                SaveHouse(i);
                LoadHouseVisual(i, true); //Load House Visual. Now, I've added ', true': It will RELOAD now!
                return 1;
            }
         }
    }
    return 1;
}

if(!strcmp(cmdtext, "/tphousecar", true))
{
    new pName[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z;
    new houseid = cmdtext[10]; //The param. /tphousecar is 0-8. With a space, 9. Then, the param is at 10.
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    if(!strcmp(HouseInfo[houseid][hOwner], pName, false)) return SendclientMessage(playerid, COLOR_RED, "You are not the owner of the house!");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in an vehicle!"); //if is player not in an vehicle, send an message and stop (RETURN [message])
    GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
    GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
    HouseInfo[houseid][hVecX] = X;
    HouseInfo[houseid][hVecY] = Y;
    HouseInfo[houseid][hVecZ] = Z;
    HouseInfo[houseid][hVecA] = A;
    return 1;
}
Sorry for the many lines :\
Reply
#6

No One Can Help Me ?
Reply
#7

You're missing a bracket at the end of LoadHouseVisual stock and the SaveHouse stock.
Reply
#8

Quote:
Originally Posted by Denying
Посмотреть сообщение
You're missing a bracket at the end of LoadHouseVisual stock and the SaveHouse stock.
OMG Im that dumb, and I can't find it. Can you help me please *facepalm*
Reply
#9

Put a bracket just before this line:
pawn Код:
stock IsValidVehicleModel(vehiclemodel)
and before this line:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Reply
#10

Getting this ... :
pawn Код:
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(38) : warning 219: local variable "houseid" shadows a variable at a preceding level
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(67) : warning 219: local variable "houseid" shadows a variable at a preceding level
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(68) : error 055: start of function body without function header
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(70) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(77) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(80) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(83) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(86) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(90) : error 010: invalid function or declaration
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(100) : warning 219: local variable "houseid" shadows a variable at a preceding level
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(101) : error 055: start of function body without function header
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(103) : error 025: function heading differs from prototype
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(103) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(104) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(105) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(106) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(107) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(108) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(109) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(110) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(111) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(112) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(113) : error 021: symbol already defined: "dini_BoolSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(114) : error 021: symbol already defined: "dini_Get"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(115) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(116) : error 021: symbol already defined: "dini_IntSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(117) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(118) : error 021: symbol already defined: "dini_FloatSet"
C:\Users\User\Desktop\New folder\filterscripts\Drugs_System.pwn(119) : error 021: symbol already defined: "dini_Float"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)