[Include] New CallBack!! [OnGBugAbuse(playerid,vehicleid)]
#4

been silly to use timer, that was more advantageous to use.

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;
}
change

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;
}
include good outside and simple, thanks.
Reply


Messages In This Thread
New CallBack!! [OnGBugAbuse(playerid,vehicleid)] - by BroZeus - 08.05.2014, 14:34
Re: New CallBack!! [OnGBugAbuse(playerid,vehicleid)] - by Younes44 - 08.05.2014, 14:40
Re: New CallBack!! [OnGBugAbuse(playerid,vehicleid)] - by BroZeus - 08.05.2014, 14:50
Re: New CallBack!! [OnGBugAbuse(playerid,vehicleid)] - by Hwang - 24.05.2014, 18:45

Forum Jump:


Users browsing this thread: 3 Guest(s)