Jump to content

Question

Posted

Nick: John_Ionut

Problema: Am un bug pe server! :) Daca cineva da "/fdeposit -suma" ii da bani, nu ii baga! Si daca pune peste limita lasa seiful in minus!

Erori / warnings: ---

Lini/script:

[pawn]new x = PlayerInfo[playerid][pMember],string[100],cashdeposit;

if(sscanf(params, "d", cashdeposit)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /fdeposit <money>");

if(cashdeposit < 1 || cashdeposit > 10000000) return SCM(playerid,COLOR_WHITE,"{FFB870}Money limit is $1 - $10,000,000.");

if(IsPlayerInRangeOfPoint(playerid,50.0,DynamicFactions[x][fcX],DynamicFactions[x][fcY],DynamicFactions[x][fcZ]))

{

if(GetPlayerCash(playerid) >= cashdeposit)

{[/pawn]

Ai incercat sa rezolvi singur ?: Cam da!

8 answers to this question

Recommended Posts

Posted

Si mai exact ceri ajutor in legatura cu ce?

Daca e vorba de acele warning-uri, treaba e simpla. Sterge declararea variabilei "str" din liniile 41309 si 42119 si a variabilei "string" de la liniile 41524, 42054, 42076, 42119. De la 42119 sterge si cashdeposit si oldbalance.

Si ce este cu cele 50000 caracterE? Unde iti da eroarea aia? Pune toate erorile din compiler.

Posted

Poftim.

[pawn]CMD:fdeposit(playerid, params[])

{

if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");

if(IsPlayerConnected(playerid))

{

    if(DepositMoney(playerid))

    {

new x = PlayerInfo[playerid][pMember],string[100],cashdeposit;

if(sscanf(params, "d", cashdeposit)) return SendClientMessage(playerid, 0xFFFFFFFF, "{8EC837}Scrie:{FFFFFF} /fdeposit <money>");

if(cashdeposit < 1 || cashdeposit > 10000000) return SCM(playerid,COLOR_WHITE,"{FFB870}Money limit is $1 - $10,000,000.");

if(IsPlayerInRangeOfPoint(playerid,50.0,DynamicFactions[x][fcX],DynamicFactions[x][fcY],DynamicFactions[x][fcZ]))

{

if(GetPlayerCash(playerid) >= cashdeposit)

{

new oldbalance = DynamicFactions[x][fBank];

DynamicFactions[x][fBank] += cashdeposit;

GivePlayerCash(playerid, -cashdeposit);

Update(playerid,pCashx);

new str[184];

format(str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);

mysql_query(SQL,str);

SendClientMessage(playerid, CRISTIAN, "Safebox:");

format(string, sizeof(string), " Old Balance: $%s", FormatNumber(oldbalance));

SendClientMessage(playerid, COLOR_WHITE, string);

format(string, sizeof(string), " Deposit: +$%s ", FormatNumber(cashdeposit));

SendClientMessage(playerid, COLOR_WHITE, string);

    format(string, sizeof(string), " New balance: $%s", FormatNumber(DynamicFactions[x][fBank]));

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have that amount of money.");

}

else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You are not in HQ.");

}

}

return 1;

}

CMD:fwithdraw(playerid, params[])

{

if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");

if(IsPlayerConnected(playerid))

{

  if(PlayerInfo[playerid][pLeader] !=0)

    {

if(PlayerInfo[playerid][pLeader] >= 1)

{

new cashdwithdraw,x = PlayerInfo[playerid][pLeader],string[100];

if(sscanf(params, "d", cashdwithdraw)) return SendClientMessage(playerid, 0xFFFFFFFF, "{8EC837}Scrie:{FFFFFF} /fwithdraw <money>");

if(GetPlayerInterior(playerid) == 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You are not in HQ.");

if(IsPlayerInRangeOfPoint(playerid,50.0,DynamicFactions[x][fcX],DynamicFactions[x][fcY],DynamicFactions[x][fcZ]))

{

if(cashdwithdraw <= DynamicFactions[x][fBank] || cashdwithdraw < 1 || cashdwithdraw > 10000000)

{

new oldbalance1 = DynamicFactions[x][fBank];

GivePlayerCash(playerid,cashdwithdraw);

Update(playerid,pCashx);

DynamicFactions[x][fBank] -= cashdwithdraw;

new str[184];

format(str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);

mysql_query(SQL,str);

    SCM(playerid, CRISTIAN, "Safebox:");

    format(string, sizeof(string), "Old Balance: $%s ", FormatNumber(oldbalance1));

    SCM(playerid, COLOR_WHITE, string);

format(string, sizeof(string), "Withdraw: -$%s ", FormatNumber(cashdwithdraw));

SCM(playerid, COLOR_WHITE, string);

                        format(string, sizeof(string), "New balance: %s %", FormatNumber(DynamicFactions[x][fBank]));

SCM(playerid, COLOR_WHITE, string);

return 1;

}

else return SCM(playerid, COLOR_WHITE, "{FFB870}You don't have that amount of money in your faction seif.");

            }

        }

    }

    else return SCM(playerid,COLOR_WHITE, "{5CAD5C}Error: Only leaders can use this command..");

}

return 1;

}[/pawn]

Posted

Incearca

[pawn]CMD:fdeposit(playerid, params[])

{

    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");

    if(IsPlayerConnected(playerid))

    {

        if(DepositMoney(playerid))

        {

            new x = PlayerInfo[playerid][pMember],string[100],cashdeposit;

            if(sscanf(params, "d", cashdeposit)) return SendClientMessage(playerid, 0xFFFFFFFF, "{8EC837}Scrie:{FFFFFF} /fdeposit <money>");

            if(cashdeposit < 1 || cashdeposit > 10000000) return SCM(playerid,COLOR_WHITE,"{FFB870}Money limit is $1 - $10,000,000.");

            if(IsPlayerInRangeOfPoint(playerid,50.0,DynamicFactions[x][fcX],DynamicFactions[x][fcY],DynamicFactions[x][fcZ]))

            {

                if(GetPlayerCash(playerid) >= cashdeposit)

                {

                    new oldbalance = DynamicFactions[x][fBank];

                    DynamicFactions[x][fBank] += cashdeposit;

                    GivePlayerCash(playerid, cashdeposit);

                    Update(playerid,pCashx);

                    new str[184];

                    format(str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);

                    mysql_query(SQL,str);

                    SendClientMessage(playerid, CRISTIAN, "Safebox:");

                    format(string, sizeof(string), " Old Balance: $%s", FormatNumber(oldbalance));

                    SendClientMessage(playerid, COLOR_WHITE, string);

                    format(string, sizeof(string), " Deposit: +$%s ", FormatNumber(cashdeposit));

                    SendClientMessage(playerid, COLOR_WHITE, string);

    format(string, sizeof(string), " New balance: $%s", FormatNumber(DynamicFactions[x][fBank]));

                    SendClientMessage(playerid, COLOR_WHITE, string);

                return 1;

                }

                else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You don't have that amount of money.");

            }

            else return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You are not in HQ.");

        }

    }

    return 1;

}[/pawn]

 

 

Posted

Imi zice ca n-am cum sa postez mai mult de 50.000 caractere! :( Dar uite pe scurt:

[pawn][...] [...]

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(41309) : warning 219: local variable "str" shadows a variable at a preceding level

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(41524) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42054) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42076) : warning 219: local variable "string" shadows a variable at a preceding level

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42119) : warning 203: symbol is never used: "cashdeposit"

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42119) : warning 203: symbol is never used: "oldbalance"

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42119) : warning 203: symbol is never used: "str"

D:\Totul despre SAMP\New Server\gamemodes\Copy of BigZone.pwn(42119) : warning 203: symbol is never used: "string"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

17 Errors.[/pawn]

Le-am pus la urma ca restul sunt de la STRING! :| ...

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.