PDA

View Full Version : help in vehicle of dm +rep!!


[M.A]Angel[M.A]
07/08/2012, 11:26 PM
Hello, i'v stunt server and i want that if someone entered Rhino or hunter can't attack if pressed Fire and if pressed to kill them or warn them is can this be in code?

OnPlayerKeyStateChange..

I think its will be here

milanosie
07/08/2012, 11:28 PM
No, it will be in public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

But I don't think it's possible to stop them from firing rockets since rockets are Client side/GTA sided, and not server sided.

[M.A]Angel[M.A]
07/08/2012, 11:29 PM
No, it will be in public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

But I don't think it's possible to stop them from firing rockets since rockets are Client side/GTA sided, and not server sided.

i dont mean to stoping them , but to kill them this is easy SetPlayerHealth(playerid,0); and client msg that You are not allowed to DM

milanosie
07/08/2012, 11:32 PM
Angel[M.A];2040473']i dont mean to stoping them , but to kill them this is easy SetPlayerHealth(playerid,0); and client msg that You are not allowed to DM

It's indeed easy, but if you know how to do it then why are you asking for help?

[DOG]irinel1996
07/08/2012, 11:33 PM
As milanosie said, it's impossible to shot at least one rocket.
You can do this:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE) {
if(!IsPlayerInAnyVehicle(playerid)) return 1;
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 432 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 425) { //Rhino, Hydra, Hunter
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid,-1,"In this server isn't allowed deathmach.");
}
}
return 1;
}


Best regards! :)

[M.A]Angel[M.A]
07/08/2012, 11:52 PM
As milanosie said, it's impossible to shot at least one rocket.
You can do this:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE) {
if(!IsPlayerInAnyVehicle(playerid)) return 1;
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 432 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 520 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 425) { //Rhino, Hydra, Hunter
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid,-1,"In this server isn't allowed deathmach.");
}
}
return 1;
}

Best regards! :)
ty thank you man i will test it !!

[M.A]Angel[M.A]
08/08/2012, 12:20 AM
Bro what is the key Ctrl In Samp Pawno?

[DOG]irinel1996
08/08/2012, 02:49 AM
Check GetPlayerKeys in the wiki, you'll see the list with all keys. ;)
Best reagards!
_________________________________
EDIT:
It's KEY_ACTION.

Default onfoot: TAB
Default in vehicle: ALT GR/LCTRL/NUM0

[M.A]Angel[M.A]
08/08/2012, 04:16 PM
Ty dude , thank you +rep!