felixms / arma-rcon-class-php

A lightweight client for sending commands easily to a BattlEye server.
MIT License
46 stars 22 forks source link

sayPlayer Wrong Parameters #21

Closed cat24max closed 7 years ago

cat24max commented 7 years ago

Am I stupid? I am providing an integer for the player and a message as a string and the answer I get is "Wrong parameter type(s)!"

Am I doing something wrong?

felixms commented 7 years ago

Mmh, something must be wrong with your code :/ This snippet validates the parameter types:

if (!is_int($player) || !is_string($message)) {
       throw new \Exception('Wrong parameter type(s)!');
}
felixms commented 7 years ago

If you are 100% sure, that your types are correct, you can work around by sending the command "manually":

$arc->command("Say $player $message")
cat24max commented 7 years ago

I have just double checked my types... The player ID is even intval()'ed before and the message is a string. I am sending the command over a JSON api, so I'll have to look into that again.

cat24max commented 7 years ago

Anyway, it works with the manual say command