Adding Textdraw on checkpoints
#1

Alright so i have this checkpoint
cpbankmenu = CreateDynamicCP(2316.2144,-8.2332,26.7422,1.0,-1,-1,-1,100.0);
And i want a textdraw to appear when i enter that checkpoint.
can anyone post how to do it in detail?
Reply
#2

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid); //enter checkpoint
    if(checkpointid == cpbankmenu){
        //TextDrawShowForPlayer
    }
    return true;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid);  //exit checkpoint
    if(checkpointid == cpbankmenu){
        //TextDrawHideForPlayer
    }
    return true;
}
Reply
#3

Tried it and cannot get it to work.
Reply
#4

pawn Код:
// Textdraws
new TD_BankMenu;

// Checkpoints
new CP_BankMenu;

public OnGameModeInit()
{
    // Create textdraws
    TD_BankMenu = TextDrawCreate(...);

    // Create checkpoints
    CP_BankMenu = CreateDynamicCP(2316.2144, -8.2332, 26.7422, 1.0, -1, -1, -1, 100.0);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == cpbankmenu)
    {
        TextDrawShowForPlayer(playerid, TD_BankMenu);
    }
    return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == cpbankmenu)
    {
        TextDrawHideForPlayer(playerid, TD_BankMenu);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)