NodeJS library for Scripting San Andreas Multiplayer : SAMP depends on samp-node plugin
some part of source code was auto generated with NodeJS
Step 0 install samp-node
Step 1 install samp-node-lib via npm
npm i samp-node-lib
import {
ManualVehicleEngineAndLights,
OnGameModeInit,
OnPlayerCommandText
} from "samp-node-lib";
OnGameModeInit(() => {
ManualVehicleEngineAndLights();
});
//
OnPlayerCommandText((player, cmdtext) => {
player.SendClientMessage('rgba(255,0,0,1)', cmdtext)
});
import {
DynamicObject,
OnGameModeInit,
OnPlayerCommandText
} from "samp-node-lib";
let o1: DynamicObject;
let o2: DynamicObject;
OnGameModeInit(() => {
o1 = new DynamicObject(3049, 808.012, 842.4, 10.9, 0.0, 0.0, 293.198)
.setOpen(806.29, 846.4, 10.9, 0.0, 0.0, 293.2);
o2 = new DynamicObject(3050, 808, 842.4, 10.9, 0.0, 0.0, 114.988)
.setOpen(809.5, 839.2, 10.9, 0.0, 0.0, 114.99);
});
OnPlayerCommandText((player, cmdtext) => {
if (cmdtext === '/open') {
o1.open();
o2.open();
return 1;
}
if (cmdtext === '/close') {
o1.close();
o2.close();
return 1;
}
});