Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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()
- {
- print("\n--------------------------------------");
- print(" Comandos Para Servers By Ronald");
- print("--------------------------------------\n");
- SetTimer("Counter",1000,1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp("/pinchar",cmdtext,true)) {
- if(!IsPlayerInAnyVehicle(playerid)) {
- SendClientMessage(playerid,-1,"Debes estar en un vehiculo para poder usar este comando");
- return 1;
- }
- new panels,doors,lights,tires,vehicleid = GetPlayerVehicleID(playerid);
- GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
- UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 0x5);
- return 1;
- }
- return 0;
- }
- //////////////
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment