[Q] How to / Is it possible ? - 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: [Q] How to / Is it possible ? (
/showthread.php?tid=309921)
[Q] How to / Is it possible ? -
Tautwis - 09.01.2012
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.
Re: [Q] How to / Is it possible ? -
Konstantinos - 09.01.2012
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
if he fire 6 rockets..
pawn Код:
if(rockets[playerid] == 6) {
// Code
}
Re: [Q] How to / Is it possible ? -
Tautwis - 09.01.2012
Thanks ! +REP
Re: [Q] How to / Is it possible ? -
Tautwis - 10.01.2012
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;
}