compiler quits responding
#1

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
Reply
#2

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

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
Reply
#4

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
Reply
#5

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

Nope

went through everything and theres something wrong in the cmd
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 4 Guest(s)