Help in /licenses menu!!
#1

Guys i just made a new cmd with dialog /licenses and i want some help!! Its for freeroam/roleplay! I made cmd + dialog response also and i made 3 license options! driving lic+bike lic+flying+lic now i want this that if i will click on driving school it will tp me there and if i will tp on bike school it will tp me there and if i will click on flying school it will tp me there, i made SetPlayerPos and i entered driving school position, when i click on driving school it tp me there and whenever i click on bike or flying school it also tp me to driving school so plz help me!!

Here's The Code

PHP код:
CMD:licenses(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_LICENSESDIALOG_STYLE_LIST"Licenses""{FF0000}Driving License\n{0000FF}Bike License\n{00FF00}Flying License""Select""Cancel");
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    
pdialog[playerid] = -1;
    new 
string[256], tmp2[256], playername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME], tmp[256], temp1temp2temp3;
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    if(
dialogid == DIALOG_LICENSES)
    {
         if (
response)
         {
             if (
dini_Isset(AddDirFile(dir_userfilesplayername), "license")) return SendClientMessage2(playerid
COLOR_RED"You already have that license, drive to the school!");
             if (
GetPlayerWantedLevel(playerid) != 0) return SendClientMessage2(playeridCOLOR_RED"You are a wanted player, so you cannot teleport to the school!");
             
SetPlayerPos(playerid, -2026.662, -91.40935.320);
         }
         return 
1;
    } 
EDIT:SetPlayerPos(playerid, -2026.662, -91.409, 35.320); this is position for driving school!
Again Edit: If the player already has license like driving license, he will type /licenses and when he will click on driving license it will show that you already have that license, i want same with other licenses..
Reply
#2

Can you explain the problem because i don't understand you?
You want that if the players click on one of the schools it teleports you there. And then the problem you stated is that you can click on it whenever you want. What are you trying to do instead? When you have selected driving school you can't select it again? Or what? Please be more specific.
Reply
#3

Quit using Beckzyboi's leaked gamemode and develop your own for once.
Reply
#4

Use cases.
Take a look at this https://sampwiki.blast.hk/wiki/OnDialogResponse at DIALOG_STYLE_LIST
Reply
#5

Take a look at the link I gave you.
I won't spoon-feed any code.
Reply
#6

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Can you explain the problem because i don't understand you?
You want that if the players click on one of the schools it teleports you there. And then the problem you stated is that you can click on it whenever you want. What are you trying to do instead? When you have selected driving school you can't select it again? Or what? Please be more specific.
Sir, sorry for my english... i made 3 options listed above, i gave position for driving school and when i do /licenses and then click on driving school it tp me there but when i click on bike or flying school it also tp me to drivingschool, so i want that if players will click on one of the schools it will teleports you there..instead of just tping to driving school!
Reply
#7

Quote:
Originally Posted by Exhibit
Посмотреть сообщение
Quit using Beckzyboi's leaked gamemode and develop your own for once.
It's not beckzyboi's script for your kindly information!
Reply
#8

Listitem is what u need. The option u click on in stored in listitem.
Driving
Flying
Boating

If u select driving, listitem Will have the value 0, when select flying, it has the value 1 etc.
So something like this:
PHP код:
if(listitem==1)
{
// tp to flying

Reply
#9

Quote:
Originally Posted by Verc
Посмотреть сообщение
Use cases.
Take a look at this https://sampwiki.blast.hk/wiki/OnDialogResponse at DIALOG_STYLE_LIST
Thnx i did it
Reply
#10

But where to put these lines? last help please
PHP код:
if (dini_Isset(AddDirFile(dir_userfilesplayername), "license")) return SendClientMessage2(playeridCOLOR_RED"You already have that license, drive to the school!");
    if (
GetPlayerWantedLevel(playerid) != 0) return SendClientMessage2(playeridCOLOR_RED"You are a wanted player, so you cannot teleport to the school!"); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)