From 81163492879b3732c58ad7d7d22b4e0f2a5ddf9c Mon Sep 17 00:00:00 2001 From: Niels Peretzke Date: Sat, 17 Aug 2019 23:58:25 +0000 Subject: [PATCH] Add new file --- gamemodes/gamemode.pwn | 94 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 gamemodes/gamemode.pwn diff --git a/gamemodes/gamemode.pwn b/gamemodes/gamemode.pwn new file mode 100644 index 0000000..3c564d4 --- /dev/null +++ b/gamemodes/gamemode.pwn @@ -0,0 +1,94 @@ + + +#include +#include +#include + +#pragma tabsize 0 + +main() +{ + print("\n----------------------------------"); + print(" Bare Script -- TEST\n"); + print("----------------------------------\n"); +} + +public OnPlayerConnect(playerid) +{ + GameTextForPlayer(playerid,"~w~SA-MP: ~r~Bare Script",5000,5); + return 1; +} + +public OnPlayerCommandText(playerid, cmdtext[]) +{ + new idx; + new cmd[256]; + + cmd = strtok(cmdtext, idx); + + if(strcmp(cmd, "/yadayada", true) == 0) { + return 1; + } + + return 0; +} + +public OnPlayerSpawn(playerid) +{ + SetPlayerInterior(playerid,0); + TogglePlayerClock(playerid,0); + return 1; +} + +public OnPlayerDeath(playerid, killerid, reason) +{ + return 1; +} + +SetupPlayerForClassSelection(playerid) +{ + SetPlayerInterior(playerid,14); + SetPlayerPos(playerid,258.4893,-41.4008,1002.0234); + SetPlayerFacingAngle(playerid, 270.0); + SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234); + SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); +} + +public OnPlayerRequestClass(playerid, classid) +{ + SetupPlayerForClassSelection(playerid); + return 1; +} + +public OnGameModeInit() +{ + SetGameModeText("Bare Script"); + ShowPlayerMarkers(1); + ShowNameTags(1); + AllowAdminTeleport(1); + + AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,0,0,0,0,-1,-1); + + return 1; +} + +strtok(const string[], &index) +{ + new length = strlen(string); + while ((index < length) && (string[index] <= ' ')) + { + index++; + } + + new offset = index; + new result[20]; + while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) + { + result[index - offset] = string[index]; + index++; + } + result[index - offset] = EOS; + return result; +} + +