Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* SA-MP Include Pay'NSpray
- *
- * (c) by Kaliber, 2016
- *
- */
- #if !defined _samp_included
- #include <a_samp>
- #endif
- #if defined _payNspray
- #endinput
- #endif
- #define _payNspray
- /******************************************************************************/
- #define A:: a_S_
- /******************************************************************************/
- static stock const Float:paynspray[][3] = {
- {1025.05, -1024.23, 32.1}, // LS Temple
- {487.68, -1740.87, 11.13}, // LS Santa Maria
- {-1420.73, 2583.37, 55.56}, // El Quebrados
- {-1904.39, 284.97, 40.75}, // Wang Cars
- {-2425.91, 1022.33, 50.10}, // Juniper Hill
- {1975.60, 2162.16, 10.77}, // LV Redsands
- {2065.38, -1831.51, 13.25}, // Idlewood
- {-99.55, 1118.36, 19.44}, // Fort Carson
- {721.07, -455.94, 16.04}, // Dillimore
- {2393.74, 1493.01, 10.52} // LV Unused (Pyramid)
- };
- static bool:range[MAX_PLAYERS char];
- /******************************************************************************/
- public OnGameModeInit()
- {
- SetTimer(!"@playerCheck",999,1);
- #if defined a_S_OnGameModeInit
- return A::OnGameModeInit();
- #else
- return 1;
- #endif
- }
- #if defined a_S_OnGameModeInit
- forward A::OnGameModeInit();
- #endif
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit a_S_OnGameModeInit
- /******************************************************************************/
- static @playerCheck();@playerCheck()
- {
- for(new i=GetPlayerPoolSize(); i!=-1; i--)
- {
- if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
- if(!range{i} && isAtPayNSpray(i))
- {
- range{i}=true;
- CallLocalFunction(!"OnPlayerEnterPayNSpray",!"i",i);
- }
- else if(range{i} && !isAtPayNSpray(i))
- {
- range{i}=false;
- CallLocalFunction(!"OnPlayerLeavePayNSpray",!"i",i);
- }
- }
- return 1;
- }
- static stock isAtPayNSpray(i)
- {
- static j;
- for(j=0; j<sizeof(paynspray); j++)
- {
- if(IsPlayerInRangeOfPoint(i,10.0,paynspray[j][0],paynspray[j][1],paynspray[j][2])) return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement