Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Beginner Question

Experienced Elementalist
Joined
Jan 3, 2010
Messages
206
Reaction score
14
I started to learn pawn and i have small question.
Everything has to be under callbacks but what if i want to make something that doesn't suite any callback? For example i have a code like:

Code:
{
    new Float: health;
    new veh = GetPlayerVehicleID(playerid);

    GetVehicleHealth(veh, health);
    if (IsPlayerInVehicle(playerid, veh) && health < 900.0)
    {
    SendClientMessage(playerid, BLUE, "Your vehicle needs to be repaired!");
    }
    return 1;
}

Where to put it then? It can't be put randomly at the start i guess. How should i do it then? For example random if (){} case.
 
Junior Spellweaver
Joined
Jan 4, 2011
Messages
138
Reaction score
12
Hello, Im new to PAWN aswell. Im guessing onplayerupdate for this, Or to create a timer ongamemodeinit. Only because if you put it on lets say onplayerconnect, It only be run once. OnPlayerUpdate is run a few times a second, i think i read from a thread on samp's forum, But works for my anti-hackable money.
 
Joined
Aug 15, 2006
Messages
944
Reaction score
53
I started to learn pawn and i have small question.
Everything has to be under callbacks but what if i want to make something that doesn't suite any callback? For example i have a code like:

Code:
{
    new Float: health;
    new veh = GetPlayerVehicleID(playerid);

    GetVehicleHealth(veh, health);
    if (IsPlayerInVehicle(playerid, veh) && health < 900.0)
    {
    SendClientMessage(playerid, BLUE, "Your vehicle needs to be repaired!");
    }
    return 1;
}
Where to put it then? It can't be put randomly at the start i guess. How should i do it then? For example random if (){} case.

start a timer at the beginning of your script, and let that timer trigger a function that checks all players, checks if they are in a car, checks the car i they are in one, and displays the message
 
Back
Top