SA-MP Forums Archive
Phantom error, please help!?! - 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: Phantom error, please help!?! (/showthread.php?tid=234418)



Phantom error, please help!?! - BurgessGaming - 03.03.2011

I'm new to this and i followed this tutorial bit by bit and put EXACTLY the same!
[ame]http://www.youtube.com/watch?v=sLRaVeiOCdU[/ame]

But I'm getting this on compile..

C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : error 029: invalid expression, assumed zero
C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : warning 215: expression has no effect
C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : warning 215: expression has no effect
C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : error 001: expected token: ";", but found ")"
C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : error 029: invalid expression, assumed zero
C:\Users\Tyler Burgess\Documents\SA Servers\Own coded\gamemodes\csrp.pwn(303) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Here is the piece of script ....

pawn Код:
if(strcmp(cmd, "/pay", true) == 0) {    //<< error is on this line note: it is tabbed on pawno forums didnt show
    new tmp[256], tmp2[256];
    tmp = strtok(cmdtext, idx);
    tmp2 = strtok(cmdtext, idx);


    if(!strlen(tmp)) {
        SendClientMessage(playerid, COLOR_YELLOW, "Usage: /givemoney [playerid] [amount]");
        return 1;
    }

    if(!strlen(tmp2)) {
        SendClientMessage(playerid, COLOR_YELLOW, "Usage: /givemoney [playerid] [amount]");
        return 1;
    }
   
    new receiver, money;
    receive = strval(tmp);
    money = strval(tmp2);
   
    if(GetPlayerMoney(playerid) < money){
        SendClientMessage(playerid, COLOR_RED, "The amount you typed in is higher then the amount you have, Please go to your nearest bank.");
        return 1;
    }
   
    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername);
    new playername2 [MAX_PLAYER_NAME];
    GetPlayerName(receiver, playername2, sizeof(playername2);

    format(string, sizeof(string), "You received $%d from %s.", money, playername);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    format(string, sizeof(string), "You gave $%d to %s.", money, playername2);
    SendClientMessage(playerid, COLOR_YELLOW, string);
   
    GivePlayerMoney(playerid, (0 - money));
    GivePlayerMoney(receiver, money);
   
    return 1;
}



Re: Phantom error, please help!?! - Vero - 03.03.2011

Ok first can you put [PAWN] in so i can read the code properly, also what line is the error on?


Re: Phantom error, please help!?! - Stigg - 03.03.2011

Please use [PAWN] Tags with your snippet of code, makes it so much easier to read.


Re: Phantom error, please help!?! - Calgon - 03.03.2011

The tutorial is horrible. You can find a better one here.


Re: Phantom error, please help!?! - BurgessGaming - 03.03.2011

Quote:
Originally Posted by Vero
Посмотреть сообщение
Ok first can you put [PAWN] in so i can read the code properly, also what line is the error on?
sorry im such a noob lol updated


Re: Phantom error, please help!?! - Vero - 03.03.2011

I don't use strcmp but try:

if(!strcmp(cmdtext, "/pay", true,0))

but i'm not sure


- BurgessGaming - 03.03.2011

UPDATE: I change the whole script of this to that off wiki and it's doing EXACTLY the same on the same line !?!?

Third script !!?!?! still doing it! please some one