Well, so this is the most basic function of VCMP and It's giving me an Error "Wrong Number of parameters" Now even the wiki shares the same code I've written down, and It gives error. Is there an alternative to solve this issue, or am I doing something wrong?
(https://s22.postimg.cc/tp84wpild/Screenshot_12.png)
https://s22.postimg.cc/tp84wpild/Screenshot_12.png
That's very strange. It doesn't look like you're doing anything wrong. Are you sure that that's the line of the error?
Edit: Have you tried using it in MessagePlayer and PrivMessage?
Yes Of course? I guess that's an issue with the Plugin
@Stormeus . I'm currently using 04rel006, and when I just thought to try the same code back in version 04rel003, It worked great!
I checked it on 04rel006. Your script isn't correct writed, give more code from onPlayerCommand event.
function onPlayerCommand( player, cmd, text )
{
try
{
cmd = cmd.tolower();
if(cmd=="vehicles")
{
ClientMessage(" "+ GetVehicleCount() + "",player,255,255,0);
}
}
catch(e) print( "OnPlayerCommand Error: " + e );
}
Quote from: MadMax on Jun 29, 2018, 09:16 AMfunction onPlayerCommand( player, cmd, text )
{
try
{
cmd = cmd.tolower();
if(cmd=="vehicles")
{
ClientMessage(" "+ GetVehicleCount() + "",player,255,255,0);
}
}
catch(e) print( "OnPlayerCommand Error: " + e );
}
Looks fine to me. Try putting player.ID instead of GetVehicleCount() and see what happens. That'll determine whether it's actually GetVehicleCount() causing the error or if it's something else.
In your posted code is everything okey, the mistake must be in another line.
Btw you can do this that.
function onPlayerCommand( player, cmd, text )
{
try
{
cmd = cmd.tolower();
if (cmd == "vehicles") ClientMessage("Veh Count: "+GetVehicleCount(),player,255,255,0);
}
catch(e) print( "OnPlayerCommand Error: " + e );
}
Quote from: rww on Jun 29, 2018, 09:27 AMIn your posted code is everything okey, the mistake must be in another line.
Btw you can do this that.
function onPlayerCommand( player, cmd, text )
{
try
{
cmd = cmd.tolower();
if (cmd == "vehicles") ClientMessage("Veh Count: "+GetVehicleCount(),player,255,255,0);
}
catch(e) print( "OnPlayerCommand Error: " + e );
}
Same Error
Try to remove some commands and test it, if it still doesn't work, try with another commands. Error in another command, not here.
Quote from: rww on Jun 29, 2018, 09:32 AMTry to remove some commands and test it, if it still doesn't work, try with another commands. Error in another command, not here.
It's not working I've tried
Quote from: MadMax on Jun 29, 2018, 09:56 AMQuote from: rww on Jun 29, 2018, 09:32 AMTry to remove some commands and test it, if it still doesn't work, try with another commands. Error in another command, not here.
It's not working I've tried
Remove all commands expect "vehicles" and then try. If it works then it's one of your other commands. You'll then have to remove one-by-one to debug it.
Quote from: BeckzyBoi on Jun 29, 2018, 10:03 AMQuote from: MadMax on Jun 29, 2018, 09:56 AMQuote from: rww on Jun 29, 2018, 09:32 AMTry to remove some commands and test it, if it still doesn't work, try with another commands. Error in another command, not here.
It's not working I've tried
Remove all commands expect "vehicles" and then try. If it works then it's one of your other commands. You'll then have to remove one-by-one to debug it.
as I said I just tried It! GetObjectCount is working even, btw GetVehicleCount isn't
GetVehicleCount works fine for me on v30 x64. Can you tell me which server version (not release) you're using?
VCMP04_server_v22_win32
The latest version is version 30 not 22. Make sure you download it from here (https://forum.vc-mp.org/?topic=5952.msg41223#msg41223)
Quote from: NewK on Jun 29, 2018, 10:56 AMThe latest version is version 30 not 22. Make sure you download it from here (https://forum.vc-mp.org/?topic=5952.msg41223#msg41223)
It remains the same
Quote from: MadMax on Jun 29, 2018, 08:56 AMYes Of course? I guess that's an issue with the Plugin @Stormeus . I'm currently using 04rel006, and when I just thought to try the same code back in version 04rel003, It worked great!
Did you update the plugin? 04rel004 had
major SDK changes that could be causing issues like what you're seeing.
Quote from: Stormeus on Jun 29, 2018, 03:51 PMQuote from: MadMax on Jun 29, 2018, 08:56 AMYes Of course? I guess that's an issue with the Plugin @Stormeus . I'm currently using 04rel006, and when I just thought to try the same code back in version 04rel003, It worked great!
Did you update the plugin? 04rel004 had major SDK changes that could be causing issues like what you're seeing.
I'm not doing it. There are many people who do not know what they are doing. I think we have to do examples in videos [ LOL] :/