Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: zeko on May 13, 2015, 03:27 PM

Title: sellcar line bug
Post by: zeko on May 13, 2015, 03:27 PM
i found an error on this line
MessagePlayer( "[#40FF00][COMMAND] - [#F7FE2E]You have sold out your " + GetVehicleNameFromModel( FindVehicle( text.tointeger() ).Model ) + "." player);
Title: Re: sellcar line bug
Post by: . on May 13, 2015, 03:46 PM
What error?

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

... + "." + player);
Next time post the error output. Otherwise we might stop responding to your questions!
Title: Re: sellcar line bug
Post by: zeko on May 13, 2015, 04:11 PM
-_- 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 "."
Title: Re: sellcar line bug
Post by: Shadow on May 13, 2015, 04:44 PM
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);
Title: Re: sellcar line bug
Post by: . on May 13, 2015, 04:45 PM
Because + means concatenate. And without it, Squirrel doesn't know what to do.

Here's some homework for you:

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
Title: Re: sellcar line bug
Post by: zeko on May 14, 2015, 03:51 AM


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
Title: Re: sellcar line bug
Post by: MacTavish on May 14, 2015, 04:10 AM
An console error screenshot is necessary to get what is error about
Title: Re: sellcar line bug
Post by: MatheuS on May 14, 2015, 08:28 AM
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!