09.10.2012, 17:24
aqui esta el codigo completo miren ._.
Quote:
/* ================================================== |[FS] By Omegaki ================================================== */ #include <a_samp> #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new countpos[MAX_PLAYERS]; new Flame[MAX_PLAYERS][2]; forward Counter(); public OnFilterScriptInit() { SetTimer("Counter",1000,1); return 1; } public OnPlayerConnect(playerid) { countpos[playerid] = 0; return 1; } public Counter() { for(new i; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i) && countpos[i] != 0) { countpos[i]++; if(countpos[i] == 4) { countpos[i] = 0; DestroyObject(Flame[i][0]); DestroyObject(Flame[i][1]); } } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_FIRE)) { new vehid = GetPlayerVehicleID(playerid); if(GetVehicleModel(vehid) == 522) { new Float:Velocity[3]; GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]); if(Velocity[0] <1.3 && Velocity[1] < 1.3 && Velocity[0] > -1.3 && Velocity[1] > -1.3) { SetVehicleVelocity(vehid, Velocity[0]*2, Velocity[1]*2, 0.0); if(countpos[playerid] == 0) { Flame[playerid][0] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0); Flame[playerid][1] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0); AttachObjectToVehicle(Flame[playerid][0], vehid, 0.194999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000); AttachObjectToVehicle(Flame[playerid][1], vehid, -0.204999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000); countpos[playerid] = 1; } } } } } public OnPlayerDisconnect(playerid, reason) { if(countpos[playerid] != 0) { countpos[playerid] = 0; DestroyObject(Flame[playerid][0]); DestroyObject(Flame[playerid][1]); } return 1; } |