Quote:
Originally Posted by amirm3hdi
For now I'm using an include/require for all my variables to use them in each function/event,
I'll try the global method too.
Also, I'm trying to show dialog but it doesn't work at all, no errors too :/ check:
PHP код:
Event::on("PlayerSpawn", function ($player) {
$dialog = Dialog::create(5, "{00FFFF}Weapon Class", "Select", "Cancel");
foreach(getWeaponClasses() as $class) {
$dialog->addRow("{FFFF00}$class[name]\t{DDDDDD}".
Server::getWeaponName($class[weapons][0][0])." ($class[weapons][0][1])\t".
Server::getWeaponName($class[weapons][1][0])." ($class[weapons][1][1])\t".
Server::getWeaponName($class[weapons][2][0])." ($class[weapons][2][1])",
$class
);
};
$dialog->on("Success", function($player, $dialog, $class) {
echo gettype($class);
})->showPlayer($player);
});
Another question, is it okay to use normal samp functions? like ShowPlayerDialog?
|
What does
getWeaponClasses() returns(an object, array, etc) and looks like? Also what is the dialog supossed to do, because your code looks strange.