Give player score every 60 seconds
#1

Okay, so I want to make sure the is over a specified height, and then if if they are, it will give them +1 score.

I also have a function called "IsAircraft(vehicleid)" and it will return true if they are in a aircraft, so I want to make sure they are in one too.
Reply
#2

Bump.
Reply
#3

Use a timer

Use GetVehiclePos(GetPlayerVehicleID, X , Y, Z);

Use if(Y > 1000) or how high you want...
Reply
#4

I know how to make a timer, but it's not letting me get the playerid.
Reply
#5

Did you use a Loop?
Reply
#6

Quote:
Originally Posted by Tɧ϶ Tσηί™
Did you use a Loop?
I don't know how I would use it to only do it for the person thats in the sky.

I need it to start the timer for 60seconds, and everytime it checks that they are in the air, and if they are it will add 1 point to their score.

I just need the things for the timer which I can get to start once they enter the airplane all I need is to check if they are over 7568 in height, and if they are, add a point.
Reply
#7

Quote:
Originally Posted by Memoryz
Quote:
Originally Posted by Tɧ϶ Tσηί™
Did you use a Loop?
I don't know how I would use it to only do it for the person thats in the sky.

I need it to start the timer for 60seconds, and everytime it checks that they are in the air, and if they are it will add 1 point to their score.

I just need the things for the timer which I can get to start once they enter the airplane all I need is to check if they are over 7568 in height, and if they are, add a point.
I'm not sure, but it should be a "for new" loop, just example

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
And trying making a Callback for it the entire thing.....I'm new still so i'm just trying to help

NOTE:

Sorry, I'll Add more to this when i can think of it.
Reply
#8

Im thinking now, is it possibly to do it with onplayerupdate?
Reply
#9

Modify this I guess:

Код:
public ScoreUpdate()
{
   for(new i; i < MAX_PLAYERS; i++)
   {
     if(IsPlayerConnected(i))
     {
        SetPlayerScore(i,GetPlayerScore(i)+1);
     }
   }
   return 1;
}
At the top:
Код:
forward ScoreUpdate();
OnGameModeInit:
Код:
 	ScoreTimer = SetTimer("ScoreUpdate",60000,1);
Reply
#10

Quote:
Originally Posted by LV CNR
Modify this I guess:

Код:
public ScoreUpdate()
{
   for(new i; i < MAX_PLAYERS; i++)
   {
     if(IsPlayerConnected(i))
     {
        SetPlayerScore(i,GetPlayerScore(i)+1);
     }
   }
   return 1;
}
At the top:
Код:
forward ScoreUpdate();
OnGameModeInit:
Код:
 	ScoreTimer = SetTimer("ScoreUpdate",60000,1);
Okay, I need to get the VehicleID of the person now.

Quote:

public flightpoints()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsAircraft(vehicleid))
{
SetPlayerScore(i,GetPlayerScore(i)+1);
}
}
}
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)