Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // hello i'll show you today how to create exit/enter for a shop
- // first of all we'll need to get the cordniates of this shop so we can open it
- // we can get it through getting in game and typing /save <name> and we'll have it in a txt file in Documents Gta san andreas files
- // savedpositions.txt
- // i've opened a bare script on the localhost to get the cordnitaes you can open it too :)
- // now we get the cord of it now lets check it
- /*
- AddPlayerClass(265,2157.1899,943.3493,10.8203,268.2549,0,0,0,0,0,0); // EnterAmmu
- AddPlayerClass(265,286.1330,-82.8946,1001.5156,173.1749,0,0,0,0,0,0); // ExitAmmu we will neeed only the x.y.z
- // we're going to create a pickup in OnGamemodeinit
- */
- #if defined FILTERSCRIPT
- new ammuenterpickup;// here we type the name of the pickup that we're going to use i'll show you
- new ammuexitpickup;
- }
- public OnGameModeInit()// after we've done the pickups, we will have to do, what the player will get teleported to if he entered it?
- {
- ammuenterpickup= CreatePickup(1318,1,2157.1899,943.3493,10.8203);// here we're creating the pikcups, using CreatePickup(playerid, modelid,type,x,y,z);
- ammuexitpickup= CreatePickup(1318,1,286.1330,-82.8946,1001.5156);// we do the same here
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- /*
- AddPlayerClass(265,2157.1899,943.3493,10.8203,268.2549,0,0,0,0,0,0); // EnterAmmu
- AddPlayerClass(265,286.1330,-82.8946,1001.5156,173.1749,0,0,0,0,0,0); // ExitAmmu we will neeed only the x.y.z
- // we're going to create a pickup in OnGamemodeinit
- */
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid== ammuenterpickup)// now let me explain here we check if the player standing on pickup ammuenterpickup what will happen to him?
- {
- SetPlayerInterior(playerid,4);// we will put him in a specfic interior id lets get the interior id for example this one also we've put him in the interior id 4
- SetPlayerPos(playerid,286.1330,-82.8946,1001.5156,173);// here we teleported the player to the exit pickup so the player will be in the interior cordinates
- // we will put him in a specfic place that we've taken by /save
- // entry pickup is done
- }
- if(pickupid == ammuexitpickup)
- {
- SetPlayerInterior(playerid,0);// here is the exitpickup, we'll put the player to the interior 0 the interior that he came from
- SetPlayerPos(playerid,2157.1899,943.3493,10.8203);// here we will put the cordinates of the entry pickup so the player will be teleported to
- }
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement