Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // example of a simple bound function - a script that runs once
- //bind with /registercommand "example_simple" "void BindFunction()" "Scripts/example_simple_bind.as" "example of simple script binding, turns all players into archers"
- // or from any script with registerScriptedCommand("example_simple", "void BindFunction()", "Scripts/example_simple_bind.as", "example of simple script binding, turns all players into archers");
- //call with /example_simple
- void BindFunction()
- {
- for (int i = 0; i < getPlayerCount(); i++)
- {
- CPlayer@ player = getPlayer(i);
- if (player is null) { continue; }
- CBlob@ blob = player.getBlob();
- if (blob is null) { continue; }
- CBlob@ newBlob = server_CreateBlob("archer",0, blob.getPosition());
- newBlob.server_SetPlayer(player);
- blob.UnplugPlayer();
- blob.server_Die();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement