Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <core>
- #include <float>
- forward GetTruchHealth();
- #pragma tabsize 0
- new trailerready = 0;
- new trailerid = -1;
- new checkcounter = 0;
- main()
- {
- print("\n----------------------------------");
- print(" Bare Script\n");
- print("----------------------------------\n");
- }
- public GetTruchHealth()
- {
- if(!trailerready) {return 1;}
- new Float:health, tmp[128];
- GetVehicleHealth(trailerid, health);
- checkcounter++;
- format(tmp,sizeof(tmp),"[%d] Trailer Health = %.2f", checkcounter, health);
- return SendClientMessageToAll(0xFFFFFFFF, tmp);
- }
- 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, "/trailertest", true) == 0) {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid,X,Y,Z);
- GivePlayerWeapon(playerid, 38, 8000);
- trailerid = AddStaticVehicleEx(584,X + 20,Y,Z + 2,0.000,-1,-1,180);
- AddStaticVehicleEx(515,X + 10,Y,Z + 2,0.000,-1,-1,180);
- trailerready = 1;
- 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);
- SetTimer("GetTruchHealth",1000,1);
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- new tmp[128];
- format(tmp,sizeof(tmp),"Vehicle DEAD - vehicleid = %d | killerid = %d", vehicleid, killerid );
- SendClientMessageToAll(0xFFFFFFFF, tmp);
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement