#1

Could someone give me a link to a topic where if a player falls into the sea they die straight away?
Reply
#2

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

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

Try:
pawn Код:
forward OnPlayerStartSwimming(playerid);
forward OnPlayerStopSwimming(playerid);
At the top of your script.
Reply
#5

Sorry i sorted it out thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)