SA-MP Forums Archive
help in vehicle of dm +rep!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help in vehicle of dm +rep!! (/showthread.php?tid=366855)



help in vehicle of dm +rep!! - [M.A]Angel[M.A] - 07.08.2012

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


Re: help in vehicle of dm +rep!! - milanosie - 07.08.2012

No, it will be in
pawn Код:
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.


Re: help in vehicle of dm +rep!! - [M.A]Angel[M.A] - 07.08.2012

Quote:
Originally Posted by milanosie
Посмотреть сообщение
No, it will be in
pawn Код:
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


Re: help in vehicle of dm +rep!! - milanosie - 07.08.2012

Quote:
Originally Posted by [M.A]Angel[M.A]
Посмотреть сообщение
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?


Respuesta: help in vehicle of dm +rep!! - [DOG]irinel1996 - 07.08.2012

As milanosie said, it's impossible to shot at least one rocket.
You can do this:
pawn Код:
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!


Re: Respuesta: help in vehicle of dm +rep!! - [M.A]Angel[M.A] - 07.08.2012

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
As milanosie said, it's impossible to shot at least one rocket.
You can do this:
pawn Код:
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 !!


Re: help in vehicle of dm +rep!! - [M.A]Angel[M.A] - 08.08.2012

Bro what is the key Ctrl In Samp Pawno?


Re: help in vehicle of dm +rep!! - [DOG]irinel1996 - 08.08.2012

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



Re: help in vehicle of dm +rep!! - [M.A]Angel[M.A] - 08.08.2012

Ty dude , thank you +rep!