Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Anti-Cheat: Fast Spawn
- Author: Twixxx a.k.a Twixyck
- Date of publication: 05.06.2017
- Current version: 1.3
- Contacts:
- VK: vk.com/twixmakkord
- Skype: n.shtimenklo
- */
- #define DEFAULT_SPAWN_TIME 3000
- static
- player_spawn_time[MAX_PLAYERS],
- already_spawned_time[MAX_PLAYERS],
- player_call_spawn_count[MAX_PLAYERS];
- public OnPlayerDeath(playerid, killerid, reason)
- {
- player_spawn_time[playerid] = GetTickCount();
- #if defined ac_fastspawn__OnPlayerDeath
- ac_fastspawn__OnPlayerDeath(playerid, killerid, reason);
- #endif
- return 1;
- }
- #if defined _ALS_OnPlayerDeath
- #undef OnPlayerDeath
- #else
- #define _ALS_OnPlayerDeath
- #endif
- #define OnPlayerDeath ac_fastspawn__OnPlayerDeath
- #if defined ac_fastspawn__OnPlayerDeath
- forward ac_fastspawn__OnPlayerDeath(playerid, killerid, reason);
- #endif
- #if defined OnFastRespawnCheatDetected
- forward OnFastRespawnCheatDetected(playerid);
- #endif
- public OnPlayerSpawn(playerid)
- {
- player_call_spawn_count[playerid]++;
- already_spawned_time[playerid] = GetTickCount() - player_spawn_time[playerid];
- if(already_spawned_time[playerid] < DEFAULT_SPAWN_TIME)
- {
- if(player_call_spawn_count[playerid] == 2)
- {
- CallLocalFunction("OnFastRespawnCheatDetected", "dd", playerid, already_spawned_time[playerid]);
- }
- else return 1;
- }
- else
- {
- player_spawn_time[playerid] = 0;
- already_spawned_time[playerid] = 0;
- player_call_spawn_count[playerid] = 0;
- }
- #if defined ac_fastspawn__OnPlayerSpawn
- ac_fastspawn__OnPlayerSpawn(playerid);
- #endif
- return 1;
- }
- #if defined _ALS_OnPlayerSpawn
- #undef OnPlayerSpawn
- #else
- #define _ALS_OnPlayerSpawn
- #endif
- #define OnPlayerSpawn ac_fastspawn__OnPlayerSpawn
- #if defined ac_fastspawn__OnPlayerSpawn
- forward ac_fastspawn__OnPlayerSpawn(playerid);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement