Phantom error, please help!?!
#1

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

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

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

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

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

I don't use strcmp but try:

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

but i'm not sure
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)