18.12.2010, 14:23
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & 1024)
{
SetVehicleHealth(playerid, 1000.0); SM(playerid,rose,"You have fixed your vehicle.");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & 1024)
{
SetVehicleHealth(playerid, 1000.0); SM(playerid,rose,"You have fixed your vehicle.");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
SetVehicleHealth(playerid, 1000.0); SM(playerid,rose,"You have fixed your vehicle.");
}
return 1;
}
if (IsPlayerInAnyVehicle(playerid))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if (IsPlayerInAnyVehicle(playerid)) {
SetVehicleHealth(playerid, 1000.0); SM(playerid,rose,"You have fixed your vehicle.");
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
new veh = GetPlayerVehicleID(playerid);
if(veh) {
SM(playerid,rose,"You have fixed your vehicle."),PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
return RepairVehicle(veh);
}
}
return 1;
}
how to change the key "2" to another one so that when you press another specific key it will repair
|
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new debugg[64];
format(debugg,sizeof(debugg),"Total Value of Key(s) Pressed %d", newkeys);
SendClientMessage(playerid, -1, debugg);
return true;
}
//Then you can use if newkeys == 128 or whatever..