Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************
- Presentation of the script :
- Commands :
- Credits :
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- Changelog :
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- *****************************************************/
- // #define)
- // #define USE_MYSQL // Uncomment to use MySQL
- // #define FILTERSCRIPT // Uncomment if it is a filterscript
- // Defines of the bodyparts for OnPlayerTakeDamage and OnPlayerGiveDamage (0.3z)
- #define BODY_PART_TORSO 3
- #define BODY_PART_GROIN 4
- #define BODY_PART_LEFT_ARM 5
- #define BODY_PART_RIGHT_ARM 6
- #define BODY_PART_RIGHT_ARM 7
- #define BODY_PART_RIGHT_LEG 8
- #define BODY_PART_HEAD 9
- // Definition of the hit types for OnPlayerWeaponShot(0.3z)
- #define BULLET_HIT_TYPE_NONE 0
- #define BULLET_HIT_TYPE_PLAYER 1
- #define BULLET_HIT_TYPE_VEHICLE 2
- #define BULLET_HIT_TYPE_OBJECT 3
- #define BULLET_HIT_TYPE_PLAYER_OBJECT 4
- // Includes
- // These are my personal and usual includes.
- // If you don't use some or just don't have them, delete the line :)
- #include <a_samp>
- #include <a_npc>
- #include <a_players>
- #include <a_vehicles>
- #include <a_objects>
- #include <float>
- #include <string>
- #include <core>
- #include <file>
- #include <streamer>
- #if defined USE_MYSQL
- #include <a_mysql>
- #endif
- // News
- new cmd[32], x_nr[256], tmp[128], giveplayerid;
- // Forwards (public functions (your personnal ones/undefined ones)
- forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
- forward OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart);
- forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("[Filterscript name] by [your nick]");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print("[Gamemode name] by [your nick]");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // If you're doin a filterscript, simply use OnFilterScriptInit
- SetGameModeText("Blank script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- // If you're doin a filterscript, simply use OnFilterScriptInit
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- cmd = strtok(cmdtext, idx);
- if (strcmp(cmd, "/respawn", true) == 0)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} You've respawned !");
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
- {
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- return 1;
- }
- // Stocks
- // Yes, i still use strtok. Delete this part or comment it if you don't use it any more.
- 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