Keeping a marker on a player.
#1

Hello,
I'm thinking of Making a CMD:follow [id] for the ID 1 and 5. But I dunno how to keep the Marker on a Player, Help?
Reply
#2

Do you mean, with a checkpoint?

For instance, I could have this:

pawn Код:
//Under OnGameModeInit()

SetTimer("CheckpointTimer", 1000, 1);
pawn Код:
//at the top of the script:

Following[MAX_PLAYERS];
BeingFollowed[MAX_PLAYERS];
pawn Код:
//Under on player connect:

Following[playerid] = 0;
BeingFollowed[playerid] = 0;
pawn Код:
command(follow, playerid, params[])
{
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, GREY, "Server: /follow [playerid/name]");
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(id, x, y, z);
        SetPlayerCheckpoint(playerid, x, y, z, 5);
        Following[playerid] = 1;
        BeingFollowed[id] = 1;
    }
    return 1;
}
pawn Код:
Above the command:

forward CheckpointTimer();
public CheckpointTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(BeingFollowed[i] == 1)
        {
             new Float:x, Float:y, Float:z;
             GetPlayerPos(i, x, y, z);
             if(Following[i] == 1)
             {
                 SetPlayerCheckpoint(i, x, y, z, 5);
             }
         }
    }
    return 1;
}
Reply
#3

Yeah, a Red circle thing.
Reply
#4

Check my previous post again, edited.
Reply
#5

Alright, Thanks. +1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)