24.05.2014, 18:45
been silly to use timer, that was more advantageous to use.
change
include good outside and simple, thanks.
pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(!IsPlayerInAnyVehicle(playerid))return 1;
if(GetPlayerState(playerid)!=PLAYER_STATE_PASSENGER)return 1;
new vid;
vid=GetPlayerVehicleID(playerid);
if(IsVehicleOccupiedByDriver(vid))return 1;
shots[playerid]++;
switch(weaponid)
{
case WEAPON_COLT45,WEAPON_SILENCED,WEAPON_DEAGLE:{if(shots[playerid]>=4)SetTimerEx("OnGBugAbuse",1,false,"ii",playerid,vid);}
case WEAPON_SNIPER,WEAPON_RIFLE,WEAPON_SHOTGUN,WEAPON_SAWEDOFF,WEAPON_SHOTGSPA:{if(shots[playerid]>=3)SetTimerEx("OnGBugAbuse",1,false,"ii",playerid,vid);}
case WEAPON_UZI,WEAPON_MP5,WEAPON_AK47,WEAPON_M4,WEAPON_TEC9,WEAPON_MINIGUN:{if(shots[playerid]>=5)SetTimerEx("OnGBugAbuse",1,false,"ii",playerid,vid);}
}
return 1;
}
pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(!IsPlayerInAnyVehicle(playerid))return 1;
if(GetPlayerState(playerid)!=PLAYER_STATE_PASSENGER)return 1;
new vid;
vid=GetPlayerVehicleID(playerid);
if(IsVehicleOccupiedByDriver(vid))return 1;
shots[playerid]++;
switch(weaponid)
{
case WEAPON_COLT45,WEAPON_SILENCED,WEAPON_DEAGLE:{if(shots[playerid]>=4)OnGBugAbuse(playerid, vid);}
case WEAPON_SNIPER,WEAPON_RIFLE,WEAPON_SHOTGUN,WEAPON_SAWEDOFF,WEAPON_SHOTGSPA:{if(shots[playerid]>=3)OnGBugAbuse(playerid, vid);}
case WEAPON_UZI,WEAPON_MP5,WEAPON_AK47,WEAPON_M4,WEAPON_TEC9,WEAPON_MINIGUN:{if(shots[playerid]>=5)OnGBugAbuse(playerid, vid); }
}
return 1;
}
![Smiley](images/smilies/smile.png)