Donate to keep the servers alive!SA-MP: VC-MP:
0 Members and 1 Guest are viewing this topic.
#include <a_samp>#if defined MAX_PLAYERS#undef MAX_PLAYERS#endif#define MAX_PLAYERS 32new playerPrevWorld[MAX_PLAYERS], maxPlayers;public OnFilterScriptInit() maxPlayers = GetMaxPlayers();public OnEnterExitModShop(playerid, enterexit, interiorid){ new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid) { if(enterexit) // Enter { playerPrevWorld[playerid] = GetPlayerVirtualWorld(playerid); SetVehicleVirtualWorld(vehicleid, playerid); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) SetPlayerVirtualWorld(veh_playerid, playerid); } } else // Exit { SetVehicleVirtualWorld(vehicleid, playerPrevWorld[playerid]); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) SetPlayerVirtualWorld(veh_playerid, playerPrevWorld[playerid]); } } }}
Code: [Select]#include <a_samp>#if defined MAX_PLAYERS#undef MAX_PLAYERS#endif#define MAX_PLAYERS 32new playerPrevWorld[MAX_PLAYERS], maxPlayers;public OnFilterScriptInit() maxPlayers = GetMaxPlayers();public OnEnterExitModShop(playerid, enterexit, interiorid){ new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid) { if(enterexit) // Enter { for(new worldid = 0; worldid < maxPlayers; worldid ++) { new world_players; for(new world_playerid = 0; world_playerid < maxPlayers; world_playerid ++) { if(IsPlayerConnected(world_playerid) && playerid != world_playerid && GetPlayerVirtualWorld(world_playerid) == worldid) world_players ++; } if(!world_players) { playerPrevWorld[playerid] = GetPlayerVirtualWorld(playerid); SetVehicleVirtualWorld(vehicleid, worldid); LinkVehicleToInterior(vehicleid, interiorid); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) { SetPlayerVirtualWorld(veh_playerid, worldid); SetPlayerInterior(veh_playerid, interiorid); } } break; } } } else // Exit { SetVehicleVirtualWorld(vehicleid, playerPrevWorld[playerid]); LinkVehicleToInterior(vehicleid, 0); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) { SetPlayerVirtualWorld(veh_playerid, playerPrevWorld[playerid]); SetPlayerInterior(veh_playerid, 0); } } } }}With this you can enter modshops as passenger, also cars don't collide with eachothers inside the modshops because all vehicles inside the shops are set to empty virtual worlds.I just made it and i hope you add it to the server
#include <a_samp>#if defined MAX_PLAYERS#undef MAX_PLAYERS#endif#define MAX_PLAYERS 32new playerPrevWorld[MAX_PLAYERS], maxPlayers;public OnFilterScriptInit() maxPlayers = GetMaxPlayers();public OnEnterExitModShop(playerid, enterexit, interiorid){ new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid) { if(enterexit) // Enter { for(new worldid = 0; worldid < maxPlayers; worldid ++) { new world_players; for(new world_playerid = 0; world_playerid < maxPlayers; world_playerid ++) { if(IsPlayerConnected(world_playerid) && playerid != world_playerid && GetPlayerVirtualWorld(world_playerid) == worldid) world_players ++; } if(!world_players) { playerPrevWorld[playerid] = GetPlayerVirtualWorld(playerid); SetVehicleVirtualWorld(vehicleid, worldid); LinkVehicleToInterior(vehicleid, interiorid); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) { SetPlayerVirtualWorld(veh_playerid, worldid); SetPlayerInterior(veh_playerid, interiorid); } } break; } } } else // Exit { SetVehicleVirtualWorld(vehicleid, playerPrevWorld[playerid]); LinkVehicleToInterior(vehicleid, 0); for(new veh_playerid = 0; veh_playerid < maxPlayers; veh_playerid ++) { if(IsPlayerConnected(veh_playerid) && GetPlayerVehicleID(veh_playerid) == vehicleid) { SetPlayerVirtualWorld(veh_playerid, playerPrevWorld[playerid]); SetPlayerInterior(veh_playerid, 0); } } } }}
Quote from: ™alziЯ on November 24, 2009, 05:10:45 PMrizla u want tickle my balls with ur moustache:)?
I'm not into pawn but wouldn't it be far easier to just put the player into the virtual world with the same ID as his player ID once he enters the modshop?