Ayuda con Fs
#1

Hola que tal ? mira tengo este Fs de arreglar los coches la verdad que funciona bien pero el problema esque se activa con cualquier tecla y me gustaria activarlo con una tecla solo o algun comando si me pudierais ayudar

Quote:

#include <a_samp>
#pragma tabsize 0
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys && KEY_SUBMISSION)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid, -1,"Car fixed!");
}
}
return 1;
}

Reply
#2

Cambia esto:
if(newkeys && KEY_SUBMISSION)

por esto:
if(newkeys & KEY_SUBMISSION)
Reply
#3

pawn Код:
#include <a_samp>
#define pressed(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define released(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    //--- [FUNCION ---]
    if(pressed(KEY_SUBMISSION)) {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInVehicle(playerid, vehicleid)) {
            SetVehicleHealth(vehicleid,1000.0);
            RepairVehicle(GetPlayerVehicleID(playerid));
            PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
            SendClientMessage(playerid, -1,"Car fixed!");
        }
    }
    //--- [FUNCION ---]
    return true;
}
Reply
#4

Funciona perfecto muchisimas gracias
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)