Saturday, November 20, 2010

SAMP Scripting Tutorial: Movable Objects II | Create Objects/Pickupsinside Interiors [MTA]

Here is the code

// OnGameModeInit
CreateObject(2634,266.29434204,83.02305603,1001.18328857,0.00000000,0.00000000,270.00000000); 
CreateObject(2634,266.28244019,87.49037933,1001.18328857,0.00000000,0.00000000,270.00000000); 
lspddoor = CreateObject(976,250.19511414,72.58469391,1002.64929199,0.00000000,0.00000000,180.00000000); 
armour = CreatePickup(1242,1,254.2683,77.9845,1003.6406,-1);

// OnPlayerUpdate
if(IsPlayerInRangeOfPoint(playerid,3.0,246.4075,72.4807,1003.6406))
{
 MoveObject(lspddoor,250.19433594,72.58398438,1005.39929199,4.0);
 SetTimer("InitPos",2000,false);
}

// OnPlayerPickup
new Float:armr; GetPlayerArmour(playerid, armr);
if(pickupid == armour && armr != 100.0)
{ 
 SetPlayerArmour(playerid,100.0);
 PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
}

// InitPos()
MoveObject(lspddoor,250.19511414,72.58469391,1002.64929199,4.0);

No comments:

Post a Comment