sellcar line bug

Started by zeko, May 13, 2015, 03:27 PM

Previous topic - Next topic

zeko

i found an error on this line
MessagePlayer( "[#40FF00][COMMAND] - [#F7FE2E]You have sold out your " + GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model ) + "." player);

.

What error?

... + "." player);
You forgot another +

... + "." + player);
Next time post the error output. Otherwise we might stop responding to your questions!
.

zeko

-_- check the function again its
Quote+ GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model ) +
not
Quote+ GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model )  + "." +
and why we use + both side of "."

Shadow

Quote from: S.L.C on May 13, 2015, 03:46 PMWhat error?

... + "." player);
You forgot another +

... + "." + player);
Next time post the error output. Otherwise we might stop responding to your questions!

It's actually

... + ".", player);
QuotePS:is trash is ur home language??

.

#4
Because + means concatenate. And without it, Squirrel doesn't know what to do.

Here's some homework for you:
  • Jimmy has 6 pieces of paper.
  • Now he wishes to glue them together.
  • He glues the first 4 and starts to wonder.
  • "Why do I need to add glue on both ends?" :-\
  • And he decide to test that idea.
  • Your task is to answer: What would be the result of his action?

EDIT: @Shadow Crap, I'm used to have wrappers around those functions and the player is among the first arguments because it's more intuitive. I was wondering why the hell would he try to concatenate with a player :D
.

zeko



i know about this ( + ) i was just telling you Server give error if you use + after ( .)

QuoteJimmy has 6 pieces of paper.
Now he wishes to glue them together.
He glues the first 4 and starts to wonder.
"Why do I need to add glue on both ends?" :-\
And he decide to test that idea.
Your task is to answer: What would be the result of his action?

explane good but that's not my point

@Shadow SOrry bro Not work

MacTavish

An console error screenshot is necessary to get what is error about

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

MatheuS

MessagePlayer( "[#40FF00][COMMAND] - [#F7FE2E]You have sold out your " + GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model ) + "." player); // Here not have ","

MessagePlayer( "[#40FF00][COMMAND] - [#F7FE2E]You have sold out your " + GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model ) + ".", player); // Correct!
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.