help in vehicle of dm +rep!!
#1

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
Reply
#2

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.
Reply
#3

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
Reply
#4

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?
Reply
#5

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!
Reply
#6

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 !!
Reply
#7

Bro what is the key Ctrl In Samp Pawno?
Reply
#8

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
Reply
#9

Ty dude , thank you +rep!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)