[Q] How to / Is it possible ?
#1

Hey, i have a question. Is there a way, to make the ammount of hydra rockets, like you fire 6 rockets, and you cannot fire anymore ? If yes, how to ? Thanks.
Reply
#2

I think it's possible OnPlayerKeyStateChange. Get vehicle id and if it's hydra
pawn Код:
new rockets[MAX_PLAYERS];
when he press the fire button
pawn Код:
rockets[playerid] ++;
if he fire 6 rockets..
pawn Код:
if(rockets[playerid] == 6) {
    // Code
}
Reply
#3

Thanks ! +REP
Reply
#4

BUMP

I dint wanted to create a new theme, so i write here.

I tryed to make this, but i failed.
What i did wrong ? What should i add / remove ? Thanks

pawn Код:
new newcar = GetPlayerVehicleID(playerid);
    if( PRESSED(KEY_SECONDARY_ATTACK) )
    {
        if(HydrosID(newcar))
        {
            rockets[playerid] ++;
            if(rockets[playerid] == 6)
            {
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "No more rockets!");
                return 0;
            }
        }
    }
pawn Код:
forward HydrosID(carid);
public HydrosID(carid)
{
    new model = GetVehicleModel(carid);
    if(model == 520)
    {
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)