TICKET SYSTEM
Hi, today i was boring so i make the basic ticket system.
Pastebin: https://pastebin.com/LefGnPAs
Code:
//LETENKY
//BY DIIGNITY
#include <a_samp>
#include <zcmd>
forward EndTeleport(playerid);
//---------------------------------------------
public OnFilterScriptInit()
{
CreatePickup(1239,1,1688.8159,-2237.5386,13.5396,-1);
Create3DTextLabel("/buyticket",0xFF0000AA,1688.8159,-2237.5386,13.5396,30,0,0);
}
//---------------------------------------------
CMD:buyticket(playerid, params[])
{
if (IsPlayerInRangeOfPoint(playerid, 7.0, 1688.8159,-2237.5386,13.5396))
{
ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "Tickets", "Desert Island (500$)", "Select", "Quit");
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not near place to buy the ticket!");
}
return 1;
}
//---------------------------------------------
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 888)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid)>=500)
{
SendClientMessage(playerid, 0xFFFFFFFF, "You buy ticket to the Desert Island");
SetPlayerPos(playerid, 1.808619,32.384357,1199.593750);
SetCameraBehindPlayer(playerid);
SetTimerEx("EndTeleport", 10000, false, "i", playerid);
GivePlayerMoney(playerid,-500);
}
}
}
}
return 0;
}
//---------------------------------------------
public EndTeleport(playerid)
{
SetPlayerPos(playerid, -699.1899,-7450.6929,37.9266);
SendClientMessage(playerid, 0xFFFFFFFF, "((PLANE)) The plane landed, we wish you a nice day.");
return 1;
}