Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (
/showthread.php?tid=259961)
Help -
muhib777 - 06.06.2011
Could someone give me a link to a topic where if a player falls into the sea they die straight away?
Re: Help -
Mean - 06.06.2011
First include
this.
Then add anywhere in your script:
pawn Код:
public OnPlayerStartSwimming( playerid ) {
SetPlayerHealth( playerid, 0.0 );
return 1;
}
If that doesn't work, try putting this in OnPlayerUpdate (or a timer):
pawn Код:
public OnPlayerUpdate( playerid ) {
if( IsPlayerSwimming( playerid ) ) {
SetPlayerHealth( playerid, 0.0 );
}
return 1;
}
Simple, ain't it?
EDIT: By the way, it doesn't work while you're in a car.
Re: Help -
muhib777 - 06.06.2011
Great making progress but i made a inc file in include using pawn then got these messages
(180 ) : warning 235: public function lacks forward declaration (symbol "OnPlayerStartSwimming")
(188 ) : warning 235: public function lacks forward declaration (symbol "OnPlayerStopSwimming")
Re: Help -
brett7 - 06.06.2011
Try:
pawn Код:
forward OnPlayerStartSwimming(playerid);
forward OnPlayerStopSwimming(playerid);
At the top of your script.
Re: Help -
muhib777 - 06.06.2011
Sorry i sorted it out thank you