PDA

View Full Version : help plz.. (error 027: invalid character constant)


GameOvr
22/07/2018, 01:41 PM
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 (c) 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??

Florin48
22/07/2018, 01:43 PM
try

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

if it does not work use strcmp

GameOvr
22/07/2018, 01:48 PM
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

Verc
22/07/2018, 01:59 PM
He said " not ' ,It's different.
It's all in the wiki http://wiki.sa-mp.com/wiki/Strcmp

GameOvr
22/07/2018, 02:06 PM
so tell me is this correct

if(strcmp("10"))
{
if(GetPlayerMoney(playerid) >= 200)
{
GivePlayerWeapon(playerid, 22, 100);
GivePlayerMoney(playerid, -200);
}
}

Florin48
22/07/2018, 02:10 PM
if(strcmp(inputtext[0], "10", true) == 0)
{

.... your code
}

GameOvr
22/07/2018, 02:23 PM
if(strcmp(inputtext[0], "10", true) == 0)
{

.... your code
}

thank you very much .. it compiled but is there another way other than strcmp

Florin48
22/07/2018, 02:30 PM
Try what I said in the above message and see if it works.

GameOvr
22/07/2018, 04:06 PM
sorry for bump just wanna thanks
Thank you bro(Florin48) I made my awesome ammunation system cuz of you