SA-MP Forums Archive
compiler quits responding - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: compiler quits responding (/showthread.php?tid=208467)



compiler quits responding - DeltaAirlines12 - 08.01.2011

so i've got
pawn Код:
dcmd(hdeposit,8,cmdtext);
and
pawn Код:
dcmd_hdeposit(playerid,params[])
{
    #pragma unused params
    new pName[MAX_PLAYER_NAME],file[256],string[128],string2[128];
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        GetPlayerName(playerid,pName,sizeof(pName));
        if(!IsPlayerInRangeOfPoint(playerid, 3, HInfo[i][HX], HInfo[i][HY], HInfo[i][HZ])) continue;
        format(string,sizeof(string),"%s",pName);
        format(file,sizeof(file),"Houses/%d.ini",i);
        if(strcmp(HInfo[i][Owner], string, true) != 0) return SendClientMessage(playerid,COLOR_ERROR,"You are not the owner of this house, only the owner can deposit money.");
        if(sscanf(params, "d", moneydeposit)) return SendClientMessage(playerid, COLOR_ERROR, "Usage: /hdeposit [Amount Of Money To Deposit]");
        if(moneydeposit == 0) return SendClientMessage(playerid,COLOR_ERROR,"You cannot deposit less then $1.");
        dini_IntSet(file, "StoreCash", + mondeydeposit);
            HInfo[i][StoreCash] = moneydeposit + HInfo[i][StoreCash];
        format(string2,sizeof(string),"You have deposited $%d into your house safe. You have a total of $%d now.",moneydeposit,moneydeposit + HInfo[i][StoreCash]);
        SendClientMessage(playerid,COLOR_GREY,string);
        return 1;
    }
    SendClientMessage(playerid,COLOR_ERROR,"You are not near a house, you must be near the door of the house to deposit money.");
    return 1;
}
and at top
pawn Код:
enum House
{
        Price,
        Locked,
        Float: HX,
        Float: HY,
        Float: HZ,
        Owner[MAX_PLAYER_NAME],
        bool: Owned,
        Interior,
        Float: TeleX,
        Float: TeleY,
        Float: TeleZ,
        StoreCash
}
But in my command, is something wrong? why won't compiler respond? Thanks


Re: compiler quits responding - Mr.Stranger - 08.01.2011

how are you so sure that there is a problem on these commands only.


Re: compiler quits responding - veyron - 08.01.2011

there is 1 mistake I've found
you are using
pawn Код:
#pragma unused params
but you are using params to get the amount, so you should remove this line
basically you are telling compiler that you arent using thing that you need to use


Re: compiler quits responding - DeltaAirlines12 - 08.01.2011

Because when I comment this command the compiler compiles fine with no quitting responding or errors.

Quote:
Originally Posted by veyron
Посмотреть сообщение
there is 1 mistake I've found
you are using
pawn Код:
#pragma unused params
but you are using params to get the amount, so you should remove this line
basically you are telling compiler that you arent using thing that you need to use
removed it, but its still not responding


Re: compiler quits responding - Mr.Stranger - 08.01.2011

it might be missing "{" or "}". There is no problem in your given code. There is problem somewhere in your Gamemode/Filtescript maybe


Re: compiler quits responding - DeltaAirlines12 - 08.01.2011

Nope

went through everything and theres something wrong in the cmd


Re: compiler quits responding - veyron - 08.01.2011

dini_IntSet(file, "StoreCash", + mondeydeposit);
havent used dini for long time, but i dont think it should be like this


Re: compiler quits responding - Mr.Stranger - 08.01.2011

nope I tested your commands on a blank page and it compiles fine. Must be a miss sign