Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Libraries [Library] Textdraw Actions

 
  • 0 Vote(s) - 0 Average
Library Textdraw Actions
ForT
Offline

Burgershot Member
Posts: 5
Threads: 2
Joined: Apr 2019
Reputation: 1
#1
2021-04-10, 06:28 AM (This post was last modified: 2021-04-10, 06:30 AM by ForT.)
Textdraw Actions

A simple include that shows a small action box in the center of the screen with options Y and N for the player to choose.

[font=Tahoma, Verdana, Arial, sans-serif]Download[/font]
https://github.com/dimmyi/td-actions

Preview:
Image: https://i.imgur.com/90W43SI.png
[Image: 8VQLmcn.gif]

Usage:
PHP Code:
#include <td-actions>

CMD:infernus(playerid)
{
    ShowActionForPlayer(playerid, ActionInfernus, "Do you really want to spawn a infernus in this position?", .action_time = 10000);

    return 1;
}

Action:ActionInfernus(playerid, response)
{
    if (response == ACTION_RESPONSE_YES)
    {
        new Float:x, Float:y, Float:z, Float:ang;

        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, ang);

        new vehicleid = CreateVehicle(411,
            x + 2.5 * floatsin(-ang, degrees),
            y + 2.5 * floatcos(-ang, degrees),
            z + 0.3,
            ang,
            0,
            0,
            -1);

        LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
    } else {
        SendClientMessage(playerid, -1, "You didn't want to spawn a infernus.");
    }
} 

Responses:
  1. ACTION_RESPONSE_NO_CHOOSE - When the player does not choose an option
  2. ACTION_RESPONSE_NO - When the player presses the N key
  3. ACTION_RESPONSE_YES - When the player presses the Y key
Underground: Roleplay
ip.ugsamp.com:7777

[Image: disc.png] Dimmy#3917
Awide
Offline

Burgershot Member
Posts: 62
Threads: 5
Joined: Sep 2019
Reputation: 5
#2
2021-04-10, 11:28 AM
This looks great man! Good job.
Desolation Roleplay has closed. You can download the gamemode here: https://www.burgershot.gg/showthread.php?tid=2272
Freaksken
Offline

open.mp Developer

Posts: 80
Threads: 4
Joined: Feb 2019
Reputation: 6
Location: Belgium
#3
2021-04-10, 11:49 AM
Nice!
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.
Snow
Offline

Burgershot Member
Posts: 48
Threads: 5
Joined: Oct 2020
Reputation: 2
Location: Pakistan
#4
2021-04-10, 06:53 PM
This looks pretty cool. Good job.
[Image: QIDa2vB.png]
Fawkes
Offline

Burgershot Member
Posts: 4
Threads: 1
Joined: Mar 2021
Reputation: 0
Location: United Kingdom
#5
2021-04-12, 07:37 PM
Very nice, this would work really well for voting systems and polls too
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode