18.08.2013, 09:47
I want to make it so when a player fires his gun,it shows a playermarker
and when he stops shooting it removes the marker,this is my idea,but I dont know if it will work and I cant test it right now
and when he stops shooting it removes the marker,this is my idea,but I dont know if it will work and I cant test it right now
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if( IsPlayerSpawned(playerid) && (PRESSED(KEY_FIRE)))
{
if (gTeam[playerid] == TEAM_BLUE)
{
ShowPlayerMarkers(2);
SetPlayerMarkerForPlayer(TEAM_BLUE,TEAM_RED,COLOR_BLUE );//SetPlayerMarkerForPlayer(playerid, showplayerid, color)
}
else if (gTeam[playerid] == TEAM_RED)
{
ShowPlayerMarkers(2);
SetPlayerMarkerForPlayer(TEAM_RED,TEAM_BLUE,COLOR_RED );
}
else if( IsPlayerSpawned(playerid) && (!PRESSED(KEY_FIRE)))
{
ShowPlayerMarkers(0);
}
}
if( IsPlayerSpawned(playerid) && !IsPlayerInAnyVehicle(playerid) && (PRESSED(KEY_HANDBRAKE) || RELEASED(KEY_HANDBRAKE)) )
{
if(IsPlayerAiming(playerid))
{
SetPlayerFirstPersonMode(playerid,0);
pFirstPersonTick[playerid] = GetTickCount();
}
}
return 1;
}