Buying Problem
#1

pawn Код:
new C4BUY[MAX_PLAYERS];

    if (strcmp("/buyc4", cmdtext, true) == 0)
    {
      if(C4BUY[playerid] == 1))
      {
      SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
      }
      {
        else if(C4BUY[playerid] == 0))
        }
        SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
        C4BUY[playerid] == 1))
        {
        return 1;
    }
Errors
Код:
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(61) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : warning 215: expression has no effect
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : fatal error 107: too many error messages on one line

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


5 Errors.
Whats wrong
Reply
#2

Stop starting new topics every time the problem changes slightly
Reply
#3

Sorry just didnt want to double post,
But can anyone help, Ty
Reply
#4

C4BUY[playerid] == 1)) - Is wrong

C4BUY[playerid] = 1;
Reply
#5

pawn Код:
new C4BUY[MAX_PLAYERS];

    if (strcmp("/buyc4", cmdtext, true) == 0)
    {
      if(C4BUY[playerid] == 1)
      {
      SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
      }
        else
        }
        SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
        C4BUY[playerid] = 1;
        {
        return 1;
    }
Reply
#6

Narrowed it down to 3 errors,

pawn Код:
if (strcmp("/buyc4", cmdtext, true) == 0)
    {
      if (C4BUY[playerid] == 1);
      {
      SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
      }
      {
        else
        }
        if (C4BUY[playerid] == 0);
        {
        SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
        C4BUY[playerid] == 1;
        }
        return 1;
    }
Код:
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(61) : error 036: empty statement
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(66) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(68) : error 036: empty statement
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(71) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

pawn Код:
if (strcmp("/buyc4", cmdtext, true) == 0)
    {
        if (C4BUY[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
            C4BUY[playerid] = 1;
        }
        return 1;
    }
You should really read all the posts before replying, I've already fixed it for you.. Thats the fix again above..

You should really learn the basics of Pawn...
Reply
#8

Код:
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\C4.pwn(83) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
{
83:     else
        }
Reply
#9

pawn Код:
if (strcmp("/buyc4", cmdtext, true) == 0)
    {
        if (C4BUY[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
            C4BUY[playerid] = 1;
        }
        return 1;
    }
Reply
#10

Quote:
Originally Posted by Miokie*
pawn Код:
if (strcmp("/buyc4", cmdtext, true) == 0)
    {
        if (C4BUY[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You already have C4");
        SendClientMessage(playerid, 0xFF0000AA, "You have purchased C4");
        C4BUY[playerid] = 1;
        return 1;
    }
That code dosent work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)