SA-MP Forums Archive
ATM COMPILE PROBLEM - 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: ATM COMPILE PROBLEM (/showthread.php?tid=114248)



ATM COMPILE PROBLEM - 22moody - 18.12.2009

Hi i want to put on my server ATM but wen i try compilied it apears a error at pawno with "send error raport or don't send " wat should i do ?


//----------------------------------[ATM System]-----------------------------------------------
if(strcmp(cmd, "/atmwithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1153.662,-1456.067,15.7968)
if(PlayerToPoint(3.0,playerid,1013.884,-1564.319,13.62405))
if(PlayerToPoint(3.0,playerid,602.9329,-1246.158,18.37793))
if(PlayerToPoint(3.0,playerid,-1982.66,122.8447,27.6875))
{
SendClientMessage(playerid, COLOR_GREY, " You are not near a ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmwithdraw [amount]");
format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmwithdraw [amount]");
format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much !");
return 1;
}
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), " You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/atmbank", true) == 0 || strcmp(cmd, "/atmdeposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1153.662,-1456.067,15.7968)
if(PlayerToPoint(3.0,playerid,1013.884,-1564.319,13.62405))
if(PlayerToPoint(3.0,playerid,602.9329,-1246.158,18.37793))
if(PlayerToPoint(3.0,playerid,-1982.66,122.8447,27.6875))
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not near a ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmbank [amount]");
format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmbank [amount]");
format(string, sizeof(string), " You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
GivePlayerMoney(playerid,-cashdeposit);
new curfunds = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Old Balance: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Deposit: $%d",cashdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/atmbalance", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(3.0,playerid,1153.662,-1456.067,15.7968)
if(PlayerToPoint(3.0,playerid,1013.884,-1564.319,13.62405))
if(PlayerToPoint(3.0,playerid,602.9329,-1246.158,18.37793))
if(PlayerToPoint(3.0,playerid,-1982.66,122.8447,27.6875))
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not near a ATM !");
return 1;
}
format(string, sizeof(string), " You Have $%d in your account.",PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
if(strcmp(cmd, "/dice", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new dice = random(6)+1;
if (gDice[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Throws a Dice that lands on %d", sendername,dice);
ProxDetector(5.0, playerid, string, TEAM_GREEN_COLOR,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR ,TEAM_GREEN_COLOR,TEAM_GREEN_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You Don't Have A Dice");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerToPoint(3.0,playerid,1153.662,-1456.067,15.7968)
if(PlayerToPoint(3.0,playerid,1013.884,-1564.319,13.62405))
if(PlayerToPoint(3.0,playerid,602.9329,-1246.158,18.37793))
if(PlayerToPoint(3.0,playerid,-1982.66,122.8447,27.6875))
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not near a ATM !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /atmtransfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /atmtransfer [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s transferd $%d to %s", sendername, moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}



Re: ATM COMPILE PROBLEM - SlashPT - 18.12.2009

maybe is one problem in other place bcs for me these commands work...


Re: ATM COMPILE PROBLEM - SiJ - 18.12.2009

Try commenting parts of your gamemode and see when it compiles, that means that the error is in commented part..
Example:
Let's say your gamemode script looks like this:
pawn Код:
.....................
..............................
..................
......................................
.....................
....................................
..........................................
.....................
...................................
............................
..........................................
..........................................
..........................................
1st Try:
pawn Код:
.....................
/*..............................
..................
......................................*/

.....................
....................................
..........................................
.....................
...................................
............................
..........................................
..........................................
..........................................
One part of the script got commented, now try to compile..
If pawn crashes try to comment another piece (uncomment the part you commented before!) :
pawn Код:
.....................
..............................
..................
......................................
/*.....................
....................................
..........................................
.....................*/

...................................
............................
..........................................
..........................................
..........................................
And so on till it compiltes.. :P

That's my method to check for errors...
Hope it helps you..


Re: ATM COMPILE PROBLEM - DJDhan - 18.12.2009

SiJ,that's not some time effective method to check fo errors try debuging your code...I have no idea how to do that but it is much easier and effective


Re: ATM COMPILE PROBLEM - dice7 - 18.12.2009

Your compiler crashed, because you forgot a bracket somewhere


Re: ATM COMPILE PROBLEM - SiJ - 18.12.2009

Quote:
Originally Posted by dice7
Your compiler crashed, because you forgot a bracket somewhere
If the script is big, it'll take a LOT of time to find location of missing bracket..


Re: ATM COMPILE PROBLEM - Joe Staff - 18.12.2009

In the strech of code you've shown us there is no bracket miscalculation.(Finger Method)