[HELP]Charity command !
#1

Hi ! I made /charity command that when you do it some money will be withdrawn from your character , and donated . But i get these erorrs :

Command :
pawn Код:
if(strcmp(cmd, "/charity", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /charity [amount]");
            return 1;
        }
        giveplayerid = strval(tmp)
        if(giveplayerid <= playermoney && giveplayerid >= 0);
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "%s Thank you for you donation of, $%d.",sendername,giveplayerid);
            SendClientMessage(playerid, COLOR_GREEN, string);
            GivePlayerMoney(playerid, -giveplayerid);
            PayLog(string);
        }
        else
        {
                SendClientMessage(playerid, COLOR_GRAD1, "That is not enough.");
        }
        return 1;
    }
Errors :
pawn Код:
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11523) : error 001: expected token: ";", but found "if"
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11523) : error 036: empty statement
D:\Games\GTA San Andreas\server\gamemodes\slrpg.pwn(11531) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Lines: 11523 :
pawn Код:
if(giveplayerid <= playermoney && giveplayerid >= 0);
11531 :
pawn Код:
else
Help please !
Reply
#2

pawn Код:
if(strcmp(cmd, "/charity", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_GREY, "USAGE: /charity [amount]");
            return 1;
        }
        giveplayerid = strval(tmp);
        if(giveplayerid <= playermoney && giveplayerid >= 0)
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "%s Thank you for you donation of, $%d.",sendername,giveplayerid);
            SendClientMessage(playerid, COLOR_GREEN, string);
            GivePlayerMoney(playerid, -giveplayerid);
            PayLog(string);
        }
        else
        {
                SendClientMessage(playerid, COLOR_GRAD1, "That is not enough.");
        }
        return 1;
    }
Reply
#3

Oh ok . I solved it . Thank's a lot !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)