Skip to content

Functions

Omid edited this page Dec 18, 2024 · 5 revisions

ShowCP

  • Parameters:
    • playerid - The id of the player to create checkpoint for
    • Float:x, Float:y, Float:z - The position of the checkpoint
    • colour - The colour of checkpoint's mapicon(Optional)
  • Returns:
    • INVALID_CP_ID(-1) if failed to create the checkpoint
    • The id of the checkpoint if successful
  • Remarks:
    • It will print an error message if it fails to create the checkpoint(playerid is invalid or there's no available free map icon for that player)
    • By default colour is dark red(0xAA0000FF)

DestroyCP

  • Parameters:
    • playerid: The id of the player to destroy the checkpoint for
    • cpid - The id of the checkpoint to destroy(Returned by ShowCP)
  • Returns:
    • 0 if didn't execute successfully(Invalid checkpoint id/playerid)
    • 1 if function executed successfully
  • Remarks:
    • It will print an error message if it fails to destroy the checkpoint(cpid is invalid or player is not connected)

IsValidPlayerCP

  • Parameters:
    • playerid: The id of the player to check
    • cpid - The id of the checkpoint to check(Returned by ShowCP)
  • Returns:
    • 0 if checkpoint doesn't exist or player is not connected
    • 1 if the checkpoint is valid
  • Remarks:
    • It will print an error message if playerid is not connected

DestroyAllCPs

  • Parameters:
    • playerid: The id of the player to destroy the checkpoints for
  • Returns:
    • 0 if player is not connected
    • 1 if function executed successfully
  • Remarks:
    • It will print an error message if playerid is not connected

IsPlayerInCP

  • Parameters:
    • playerid: The id of the player to check
    • cpid: The id of the checkpoint to check(Returned by ShowCP)
  • Returns:
    • false if player is not connected or cpid is invalid or player is not in the checkpoint
    • true if player is in the checkpoint
  • Remarks:
    • It will print an error message if playerid is not connected or cpid is invalid

DoesHaveAnyCP

  • Parameters:
    • playerid: The id of the player to check
  • Returns:
    • false if player is not connected or player doesn't have any checkpoint
    • true if player have at least one checkpoint
  • Remarks:
    • It will print an error message if playerid is not connected

CountPlayerCPs

  • Parameters:
    • playerid: The id of the player to count
  • Returns:
    • 0 if player is not connected or player doesn't have any checkpoint
    • The amount of checkpoints if player have at least one checkpoint
  • Remarks:
    • It will print an error message if playerid is not connected

GetCPPosition

  • Parameters:
    • playerid: The id of the player who has the CP
    • cpid: The id of the checkpoint(Returned by ShowCP)
    • &Float:x, &Float:y, &Float:z: the variables to save the position in to
  • Returns:
    • 0 if player is not connected or player doesn't have any checkpoint
    • 1 if successful
  • Remarks:
    • It will print an error message if playerid is not connected or cpid is invalid