help plz.. (error 027: invalid character constant)
#1

guys I tried to make an input style dialog but it gives the following error

error:

Код:
tdm.pwn(271) : error 027: invalid character constant
tdm.pwn(271) : error 027: invalid character constant
tdm.pwn(271 -- 272) : error 029: invalid expression, assumed zero
tdm.pwn(271 -- 272) : fatal error 107: too many error messages on one line

Compilation aborted.

Pawn compiler 3.10.8	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
[Finished in 0.1s with exit code 1]
code:
Код:
if(inputtext[0] == '10')//m4 200
            {
                if(GetPlayerMoney(playerid) >= 200)
                {
                    GivePlayerWeapon(playerid, 22, 100);
                    GivePlayerMoney(playerid, -100);
                }
            }
any help with this??
Reply
#2

try

if(inputtext[0] == "10")

if it does not work use strcmp
Reply
#3

Quote:
Originally Posted by Florin48
Посмотреть сообщение
try

if(inputtext[0] == "10")

if it does not work use strcmp
wut i already used if(inputtext[0] == "10") haven't you read

and plz tell me how to use strcmp on input style dialogs
Reply
#4

He said " not ' ,It's different.
It's all in the wiki https://sampwiki.blast.hk/wiki/Strcmp
Reply
#5

so tell me is this correct
Код:
if(strcmp("10"))
{
      if(GetPlayerMoney(playerid) >= 200)
      {
           GivePlayerWeapon(playerid, 22, 100);
           GivePlayerMoney(playerid, -200);
      }
}
Reply
#6

if(strcmp(inputtext[0], "10", true) == 0)
{

.... your code
}
Reply
#7

Quote:
Originally Posted by Florin48
Посмотреть сообщение
if(strcmp(inputtext[0], "10", true) == 0)
{

.... your code
}
thank you very much .. it compiled but is there another way other than strcmp
Reply
#8

Try what I said in the above message and see if it works.
Reply
#9

sorry for bump just wanna thanks
Thank you bro(Florin4 I made my awesome ammunation system cuz of you
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)