Errors with a cmd
#1

pawn Код:
CMD:chouse(playerid, params[])
{
    if(PlayerInfo[playerid][Padmin] >=4)
    {
        new id = HouseCount, interior, Float:X, Float:Y, Float:Z, string[128];
        if(sscanf(params,"i",interior)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /chouse <interior>");
        GetPlayerPos(playerid, X, Y, Z);
        HouseInfo[id][Interior] = interior;
        HouseInfo[id][Owned] = 0;
        HouseInfo[id][XPos] = X;
        HouseInfo[id][YPos] = Y;
        HouseInfo[id][ZPos] = Z;
        SendClientMessage(playerid, COLOR_GREEN, "You have created a house!");
        HouseEnterPickup[id]  = CreatePickup(1273,23,X,Y,Z,-1);
        new INI:file = INI_Open(HousePath(playerid));
        INI_Open(file);//Opening the file with SII.
        INI_WriteInt("Interior",interior);
        INI_WriteInt("Owned",0);
        INI_WriteFloat("XPos",X);
        INI_WriteFloat("YPos",Y);
        INI_WriteFloat("ZPos",Z);
        INI_WriteString("Owner",HouseInfo[id][Owner]);
        INI_Close(file);
        HouseCount++;
        return 1;
    }
    return 1;
}
Im using YINI and please could you explain what i have done wrong

Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2884) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2884) : warning 215: expression has no effect
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2884) : error 001: expected token: ";", but found ")"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2884) : error 029: invalid expression, assumed zero
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2884) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

soz fro double post but i havemanaged to get errors away.. but now i got tag mismath
Код:
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2888) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2889) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2890) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2891) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2892) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2893) : error 035: argument type mismatch (argument 1)
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2894) : warning 202: number of arguments does not match definition
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2900) : warning 203: symbol is never used: "HouseExit"
C:\Users\iphone\Desktop\SFCNR\gamemodes\Sfcnr.pwn(2900) : warning 203: symbol is never used: "PlayerInHouseID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
pawn Код:
CMD:chouse(playerid, params[])
{
    if(PlayerInfo[playerid][Padmin] >=4)
    {
        new id = HouseCount, interior;
        if(sscanf(params,"i",interior)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /chouse <interior>");
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        HouseInfo[id][Interior] = interior;
        HouseInfo[id][Owned] = 0;
        HouseInfo[id][XPos] = X;
        HouseInfo[id][YPos] = Y;
        HouseInfo[id][ZPos] = Z;
        SCM(playerid, COLOR_GREEN, "You have created a house!");
        HouseEnterPickup[id]  = CreatePickup(1273,23,X,Y,Z,-1);
        new file[40];
        format(file,sizeof(file),"Sfcnr/Users/Houses/%i.ini",id);
        INI_Open(file);
        INI_WriteInt("Interior",interior);
        INI_WriteInt("Owned",0);
        INI_WriteFloat("XPos",X);
        INI_WriteFloat("YPos",Y);
        INI_WriteFloat("ZPos",Z);
        INI_WriteString("Owner",HouseInfo[id][Owner]);
        INI_Close();
        HouseCount++;
        return 1;
    }
    return 1;
}
Reply
#3

Mention the lines bro.
Reply
#4

Sorry
pawn Код:
INI_WriteInt("Interior",interior);
        INI_WriteInt("Owned",0);
        INI_WriteFloat("XPos",X);
        INI_WriteFloat("YPos",Y);
        INI_WriteFloat("ZPos",Z);
Reply
#5

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
Sorry
pawn Код:
INI_WriteInt("Interior",interior);
        INI_WriteInt("Owned",0);
        INI_WriteFloat("XPos",X);
        INI_WriteFloat("YPos",Y);
        INI_WriteFloat("ZPos",Z);
He means the line numbers.
Reply
#6

Be sure you have interior in your file.
Reply
#7

im using this tutorial https://sampforum.blast.hk/showthread.php?tid=287541 :/ ive only got as far as the cmd and got these errors
Reply
#8

You need to have
pawn Код:
INI_Int("interior",interior);
To load the data. So you must put it under OnPlayerConnect.
And same for all the rest.

Read this
INI
Reply
#9

Atm im just creating the command i dont need load it just yet
Reply
#10

this is really confusing me lol im comparing it to my other yini stuff (that works) and its the same.... so why isnt it working?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)