18.04.2012, 17:58
тtima idйia, mais nгo deveria checar se estб em um veнculo antes de criar as variбveis ?
pawn Code:
CMD:fire(playerid){
if(IsPlayerInAnyVehicle(playerid)){
new Float:X,Float:Y,Float:Z,Float:A, car = GetPlayerVehicleID(playerid),model = GetVehicleModel(car);
if(ammo[car] == 0) return SendClientMessage(playerid,-1,"sem muniзгo, use /ammo");
if(model != 553) return 1;
GetPlayerPos(playerid,X,Y,Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
bomb[playerid] = CreateObject(345,X,Y,Z,A,0,0,0.0);
MapAndreas_FindZ_For2DCoord(X,Y,Z);
MoveObject(bomb[playerid],X,Y,Z,100.0,A,0.0,0.0);
CreateExplosion(X,Y,Z,10,20.0);
ammo[car] --;
DestroyObject(bomb[playerid]);
}
return 1;
}