OnPlayerKeyStateChange -,-
#1

hiya guys what's up today i got a problem of OnPlayerKeyStateChange i've made for rustler bombing but i'm getting the message while OnFoot so how i can remove it

HERE WE GO!

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_FIRE)
    {
        if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 476)
        {
            return SendClientMessage(playerid, 0xFF0000AA, "");
        }
        else
        {
            new Float:VBPos[3];
            new Float:X, Float:Y, Float:Z;
            GetVehiclePos(GetPlayerVehicleID(playerid),VBPos[0],VBPos[1],VBPos[2]);
            CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 7, 20.0);
            GetPlayerPos(playerid, X, Y, Z); // this is a message which i'm getting it while on Foot
            format(Stringz, sizeof(Stringz), "You've droped a bomb at the Destination Of "cred"%0.0f, %0.0f, %0.0f ", X, Y, Z);
            SendClientMessage(playerid, orange, Stringz);// this is 2nd message
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~>~~w~Bomb ~r~Droped~<~", 3000, 3);
        }
    }
    return 1;
}
Reply
#2

delet this : && GetVehicleModel(GetPlayerVehicleID(playerid)) != 476
i tried this one and got answer

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_FIRE)
    {
        if (
IsPlayerInAnyVehicle(playerid))
        {
            return 
SendClientMessage(playerid0xFF0000AA"");
        }
        else
        {
            new 
Float:VBPos[3];
            new 
Float:XFloat:YFloat:Z;
            
GetVehiclePos(GetPlayerVehicleID(playerid),VBPos[0],VBPos[1],VBPos[2]);
            
CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 720.0);
            
GetPlayerPos(playeridXYZ); // this is a message which i'm getting it while on Foot
            
format(Stringzsizeof(Stringz), "You've droped a bomb at the Destination Of "cred"%0.0f, %0.0f, %0.0f "XYZ);
            
SendClientMessage(playeridorangeStringz);// this is 2nd message
            
GameTextForPlayer(playerid"~n~~n~~n~~n~~>~~w~Bomb ~r~Droped~<~"30003);
        }
    }
    return 
1;

Reply
#3

brah i want to remove the SendClientMessage while on foot that's why i'm here -___-
read the message before posting
Reply
#4

You'll want to use if(newkeys & KEY_FIRE) instead otherwise it will only be true if your pressing only the fire key.
Reply
#5

nvm code?
Reply
#6

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
        {
             new Float:VBPos[3];
            new Float:X, Float:Y, Float:Z;
            GetVehiclePos(GetPlayerVehicleID(playerid),VBPos[0],VBPos[1],VBPos[2]);
            CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 7, 20.0);
            GetPlayerPos(playerid, X, Y, Z); // this is a message which i'm getting it while on Foot
            format(Stringz, sizeof(Stringz), "You've droped a bomb at the Destination Of "cred"%0.0f, %0.0f, %0.0f ", X, Y, Z);
            SendClientMessage(playerid, orange, Stringz);// this is 2nd message
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~>~~w~Bomb ~r~Droped~<~", 3000, 3);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)