Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define IsPlayerAuthorized(%0) player_is_authorized{%0}
- #define SetPlayerAuthorized(%0,%1) player_is_authorized{%0} = %1
- #define PLAYER_OFFLINE 0
- #define PLAYER_ONLINE 1
- new player_is_authorized[MAX_PLAYERS char];
- main()
- {}
- /*
- * FIXES_SpawnPlayer(playerid)
- *
- * FIXES:
- * SpawnPlayer
- */
- stock FIXES_SpawnPlayer(playerid)
- {
- // Valid "playerid" check inside "GetPlayerVehicleID".
- new
- vid = GetPlayerVehicleID(playerid);
- if (vid)
- {
- new
- Float:x,
- Float:y,
- Float:z;
- // Remove them without the animation.
- GetVehiclePos(vid, x, y, z),
- SetPlayerPos(playerid, x, y, z);
- }
- return SpawnPlayer(playerid);
- }
- #if defined _ALS_SpawnPlayer
- #undef SpawnPlayer
- #else
- #define _ALS_SpawnPlayer
- #endif
- #define SpawnPlayer FIXES_SpawnPlayer
- public OnPlayerConnect(playerid)
- {
- SetPlayerAuthorized(playerid, PLAYER_OFFLINE);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/v", cmdtext, true, 10) == 0)
- {
- new
- Float:x,
- Float:y,
- Float:z;
- GetPlayerPos(playerid, x, y, z);
- new vehicleid = CreateVehicle(411, x, y, z, 0, -1, -1, 0);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- return 1;
- }
- if (strcmp("/kill", cmdtext, true, 10) == 0)
- {
- SetPlayerHealth(playerid, 0.0 );
- return 1;
- }
- if (strcmp("/login", cmdtext, true, 10) == 0)
- {
- SetPlayerAuthorized(playerid, PLAYER_ONLINE);
- TogglePlayerSpectating(playerid, 0);
- return 1;
- }
- if (strcmp("/spawn", cmdtext, true, 10) == 0)
- {
- SpawnPlayer(playerid);
- return 1;
- }
- SendClientMessage(playerid,0xFFFFFFFF, "Неверная команда.");
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- if (IsPlayerAuthorized(playerid)) {
- return 1;
- }
- return 0;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- new
- Float:x,
- Float:y,
- Float:z;
- GetPlayerPos(playerid, x, y, z);
- RemoveBuildingForPlayer(playerid, 1484, x, y, z, 10.0);
- RemoveBuildingForPlayer(playerid, 1485, x, y, z, 10.0);
- RemoveBuildingForPlayer(playerid, 1486, x, y, z, 10.0);
- SetSpawnInfo(playerid, 0, 124, 2499.8, -2129.6001, 23.5, 92.0, 10, 1, 38, 999999, 34, 999999);
- if (IsPlayerAuthorized(playerid)) {
- SpawnPlayer(playerid);
- } else {
- TogglePlayerSpectating(playerid, 1);
- SetTimerEx("SetClassCameraPos", 200, 0, "i", playerid);
- }
- return 1;
- }
- forward SetClassCameraPos(playerid);
- public SetClassCameraPos(playerid)
- {
- SetPlayerCameraPos(playerid, 1879.984252, -2908.610107, 1.996365);
- SetPlayerCameraLookAt(playerid, 1879.666870, -2913.487304, 0.941269);
- }
Advertisement
Add Comment
Please, Sign In to add comment