works as it should. press c at zero point of the map and an object gets attached.
press c again, so that thou stand & rotation gets applied just as it should.
pawn Код:
#define FILTERSCRIPT
#include "a_samp"
#define team_prop (0)
new bool:xX;
public OnFilterScriptInit()
{
SetPlayerTeam(0,team_prop);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH))// && (newkeys & KEY_WALK) && !(oldkeys & KEY_WALK))
if(GetPlayerTeam(playerid) == team_prop)
takeObject(playerid);
return 1;
}
takeObject(playerid)
{
//if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_NONE) //Standing
if(xX)
{
xX=false;
//if(IsPlayerInRangeOfPoint(playerid,20,563.57324, -2470.08301, 20.67800))
if(IsPlayerInRangeOfPoint(playerid,20,0,0,0))
{
SendClientMessage(playerid,-1,"PROP added STANDING");
RemovePlayerAttachedObject(playerid, 1);
SetPlayerAttachedObject( playerid, 0, 18260, 10, -1.463145, 0.003660, -0.010768, 344.867675, 271.720306, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,606.86298, -2462.64893, 19.05400))
{
RemovePlayerAttachedObject(playerid, 1);
SetPlayerAttachedObject( playerid, 0, 18260, 10, -1.463145, 0.003660, -0.010768, 344.867675, 271.720306, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,627.73499, -2469.07202, 19.05400))
{
RemovePlayerAttachedObject(playerid, 1);
SetPlayerAttachedObject( playerid, 0, 18260, 10, -1.463145, 0.003660, -0.010768, 344.867675, 271.720306, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,636.60498, -2455.44092, 19.04200))
{
RemovePlayerAttachedObject(playerid, 1);
SetPlayerAttachedObject( playerid, 0, 18260, 10, -1.463145, 0.003660, -0.010768, 344.867675, 271.720306, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20, 523.91101, -2466.34595, 16.76800))
{
RemovePlayerAttachedObject(playerid, 1);
SetPlayerAttachedObject( playerid, 0, 18260, 10, -1.463145, 0.003660, -0.010768, 344.867675, 271.720306, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
}
else// if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK) //Crouching
{
xX=true;
//if(IsPlayerInRangeOfPoint(playerid,20,563.57324, -2470.08301, 20.67800))
if(IsPlayerInRangeOfPoint(playerid,20,0, 0, 0))
{
RemovePlayerAttachedObject(playerid, 0);
SetPlayerAttachedObject( playerid, 1, 18260, 10, 0.169341, -1.406103, 0.218262, 86.945274, 5.285029, 343.219879, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,606.86298, -2462.64893, 19.05400))
{
RemovePlayerAttachedObject(playerid, 0);
SetPlayerAttachedObject( playerid, 1, 18260, 10, 0.169341, -1.406103, 0.218262, 86.945274, 5.285029, 343.219879, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,627.73499, -2469.07202, 19.05400))
{
RemovePlayerAttachedObject(playerid, 0);
SetPlayerAttachedObject( playerid, 1, 18260, 10, 0.169341, -1.406103, 0.218262, 86.945274, 5.285029, 343.219879, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20,636.60498, -2455.44092, 19.04200))
{
RemovePlayerAttachedObject(playerid, 0);
SetPlayerAttachedObject( playerid, 1, 18260, 10, 0.169341, -1.406103, 0.218262, 86.945274, 5.285029, 343.219879, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
else if(IsPlayerInRangeOfPoint(playerid,20, 523.91101, -2466.34595, 16.76800))
{
RemovePlayerAttachedObject(playerid, 0);
SetPlayerAttachedObject( playerid, 1, 18260, 10, 0.169341, -1.406103, 0.218262, 86.945274, 5.285029, 343.219879, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid,-1,"Object Attached");
}
}//you could also make the function return a value to checkfor errors.
}
they press the jump-key. This could mess things up a little, in case it's not dealt with correctly that is.