Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *
- * LOOPS v1 beta - Willian_Luigi
- * Data de inicio: 08/10/2013
- * CODE.ME, 2013.1 -
- *
- */
- #if defined _wloops_included
- #endinput
- #endif
- #define _wloops_included
- #pragma library wloops
- #tryinclude <ibits>
- #tryinclude <whooks>
- forward loadVehicles();
- forward getMaxPlayers();
- forward getMaxVehicles();
- forward iDestroyVehicle(vehicleid);
- forward startPutaria();
- new gPlayersConnected, gCarsSpawned;
- /*hook_f::OnGameModeInit()
- {
- //startPutaria();
- call->OnGameModeInit();
- return nop;
- }*/
- hook_f::OnPlayerConnect(playerid)
- {
- gPlayersConnected ++;
- call->OnPlayerConnect(playerid);
- return nop;
- }
- hook_f::OnPlayerDisconnect(playerid, reason)
- {
- gPlayersConnected --;
- call->OnPlayerDisconnect(playerid, reason);
- return nop;
- }
- public loadVehicles ()
- {
- new gLoop, Float: gVehicle [ 0x03 ] , Float: gOld [ 0x03 ];
- gVehicle [ 0x00 ] = EOS , gVehicle [ 0x01 ] = EOS , gVehicle [ 0x02 ] = EOS ;
- gOld [ 0x00 ] = EOS , gOld [ 0x01 ] = EOS , gOld [ 0x02 ] = EOS ;
- while ( ++gLoop < MAX_VEHICLES )
- {
- if ( gLoop )
- {
- GetVehiclePos ( gLoop , gVehicle [ 0x00 ] , gVehicle [ 0x01 ] , gVehicle [ 0x02 ] ) ;
- GetVehiclePos ( ( gLoop - 0x01 ) , gOld [ 0x00 ] , gOld [ 0x01 ] , gOld [ 0x02 ] ) ;
- if ( ( gVehicle [ 0x00 ] == gOld [ 0x00 ] ) && ( gVehicle [ 0x01 ] == gOld [ 0x01 ] ) && ( gVehicle [ 0x02 ] == gOld [ 0x02 ] ) )
- {
- gCarsSpawned = (gLoop - 0x01);
- break ;
- }
- }
- }
- return 0x01 ;
- }
- public getMaxPlayers()
- {
- return gPlayersConnected;
- }
- public getMaxVehicles()
- {
- return gCarsSpawned;
- }
- public startPutaria()
- {
- gCarsSpawned = 0;
- gPlayersConnected = 0;
- loadVehicles();
- print("STARTED.");
- }
- stock iCreateVehicle(modelid, Float:x, Float:y, Float:z, Float:a, c1, c2, time_spawn = 0x00)
- {
- gCarsSpawned ++;
- return time_spawn ? (AddStaticVehicle(modelid, x, y, z, a, c1, c2)) : (AddStaticVehicleEx(modelid, x, y, z, a, c1, c2, time_spawn));
- }
- public iDestroyVehicle(vehicleid)
- {
- return DestroyVehicle(vehicleid), gCarsSpawned --;
- }
- #define CreateVehicle iCreateVehicle
- #define AddStaticVehicleEx iCreateVehicle
- #define AddStaticVehicle(%0,%1,%2,%3,%4,%5,%6) iCreateVehicle(%0, %1, %2, %3, %4, %5, %6, 0)
- #define DestroyVehicle iDestroyVehicle
- #define GetMaxPlayers getMaxPlayers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement