SA-MP Forums Archive
Please Help me about "VIP LOCKER" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please Help me about "VIP LOCKER" (/showthread.php?tid=500620)



Please Help me about "VIP LOCKER" - ChuckyBabe - 14.03.2014

Can someone make a script for me now i will explain

this is my current code

PHP код:
CMD:viplocker(playeridparams[])  
{  
    if(!
IsPlayerInRangeOfPoint(playerid3.01416.7363, -1680.076813.5469)) return SendClientMessage(playerid,-1"Error: You're not near the locker."); //seeing if a player is in range of x, y, z. If not, send the message.  
    
if(PlayerInfo[playerid][pDonator] > 1//Checking to see if their a vip. //VIP LOCKER credits to: rangerxll  
    
{  
        
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"VIP Locker""VIP Heal\nVIP Armor\nVIP Weapons""Select""Cancel"); //showing the locker menu.  
    
}  
    return 
1;  

I can't make a dialogid == 1
co'z i'am having a f*cking errors with that everytime i put this

PHP код:
if(dialogid == 1)
    {
         if(
response)
        {
            if(
PlayerInfo[playerid][pDonator]==1)
                
                }
            if (
listitem == 1)
                {
                
GivePlayerHeal(playerid100);
                   
format(stringsizeof(string), "* %s has got full HP"sendername);
                  
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                        }
                    }
                   } 
Can some make a script only in dialogid == 1

And add all of this in listitem under dialogid and [pDonator] that is my code for VIP's


VIP HEAL
VIP ARMOR
VIP Weapons
if he choose VIP weapons he will have another dialog box and list of guns

SPAS-12
M4A1
Sniper
Sawn-Off Shotgun
and other VIP Guns
etc...

I promise i will +rep you.

NOTE : PLEASE GIVE THE CODE OF ALL I REQUEST TO YOU AND PLEASE DO NOT GIVE A F*CKING F*CKING REPLY without any relation on what i want


Re: Please Help me about "VIP LOCKER" - Flake. - 14.03.2014

Why are you trying to check if the player is an admin in the dialog responce? If they've got that far they have to be that level anyway.

pawn Код:
if(response)
    {
        switch(dialogid)
        {
            case YOUR_DIALOG_NAME: //Change this to what ever your dialog is defined as
            {
                switch(listitem)
                {
                    case 0:
                    {

                        //The first lot of items here

                    }
                    case 1:
                    {

                        //Second lot of items

                    }
                    case 2:
                    {

                        //And you guessed it, the third lot of items

                    }


                 }
That's just the framework for it, add the items yourself it should be easier enough.


Re: Please Help me about "VIP LOCKER" - ChuckyBabe - 14.03.2014

I will change this

PHP код:
if(dialogid == 1
    { 
         if(
response
        { 
            if(
PlayerInfo[playerid][pDonator]==1
                 
                } 
            if (
listitem == 1
                { 
                
GivePlayerHeal(playerid100); 
                   
format(stringsizeof(string), "* %s has got full HP"sendername); 
                  
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); 
                        } 
                    } 
                   } 
to your code?

PHP код:
if(response)
    {
        switch(
dialogid)
        {
            case 
YOUR_DIALOG_NAME//Change this to what ever your dialog is defined as
            
{
                switch(
listitem)
                {
                    case 
0:
                    {

                        
//The first lot of items here

                    
}
                    case 
1:
                    {

                        
//Second lot of items

                    
}
                    case 
2:
                    {

                        
//And you guessed it, the third lot of items

                    
}


                 } 
And where i will put it ?


Re: Please Help me about "VIP LOCKER" - Flake. - 14.03.2014

Under OnDialogResponce


Re: Please Help me about "VIP LOCKER" - ChuckyBabe - 14.03.2014

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
    new
        
string[128],
        
sendername[MAX_PLAYER_NAME];
    if(
GetPVarInt(playerid"dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        
format(stringsizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d)."GetPlayerNameEx(playerid), playeriddialogid);
          
ABroadCast(COLOR_YELLOWstring2);
        
format(stringsizeof(string), "%s has possibly tried to spoof a dialog ID."GetPlayerNameEx(playerid));
        
AddAutomatedFlag(playeridstring);
        
format(stringsizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d)."GetPlayerNameEx(playerid), dialogidresponse);
        
Log("logs/crash.log"string);
        return 
1;
    } 
Under that ?


Re: Please Help me about "VIP LOCKER" - Mriss - 14.03.2014

Yes under that


Re: Please Help me about "VIP LOCKER" - Matess - 14.03.2014

Yeah

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
        switch(dialogid)
        {
            case YOUR_DIALOG_NAME: //Change this to what ever your dialog is defined as
            {
                switch(listitem)
                {
                    case 0:
                    {

                        //The first lot of items here

                    }
                    case 1:
                    {

                        //Second lot of items

                    }
                    case 2:
                    {

                        //And you guessed it, the third lot of items

                    }
               }  
          }
      }
  }
return 1;
}



Re: Please Help me about "VIP LOCKER" - ChuckyBabe - 14.03.2014

What will happen to this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    new
        string[128],
        sendername[MAX_PLAYER_NAME];

    if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
          ABroadCast(COLOR_YELLOW, string, 2);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }
It will ?

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
        switch(dialogid)
        {
            case YOUR_DIALOG_NAME: //Change this to what ever your dialog is defined as
            {
                switch(listitem)
                {
                    case 0:
                    {

                        //The first lot of items here

                    }
                    case 1:
                    {

                        //Second lot of items

                    }
                    case 2:
                    {

                        //And you guessed it, the third lot of items

                    }
               }  
          }
      }
  }
return 1;
}

new
        string[128],
        sendername[MAX_PLAYER_NAME];

    if(GetPVarInt(playerid, "dialog") != dialogid) { // Confirm the dialogid matches what we have in the PVar
        format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid);
          ABroadCast(COLOR_YELLOW, string, 2);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid));
        AddAutomatedFlag(playerid, string);

        format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response);
        Log("logs/crash.log", string);

        return 1;
    }
Like that ?


Re: Please Help me about "VIP LOCKER" - Flake. - 14.03.2014

It seems like you really don't understand it so here you go.

pawn Код:
//Add this at the top of your script
#define VIP_DIALOG 75 //Just making a random number so it doesn't corasopnd with other dialogs you may have.

//Your basic command
CMD:viplocker(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1416.7363, -1680.0768, 13.5469))
    {
        ShowPlayerDialog(playerid, VIP_DIALOG, DIALOG_STYLE_LIST, "VIP Locker", "VIP Heal\nVIP Armor\nVIP Weapons", "Select", "Cancel"); //showing the locker menu.
    }
    return SendClientMessage(playerid,-1, "Error: You're not near the locker."); //The fail message
    return 1;
}

Now down here is the OndialogResponce code
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == VIP_DIALOG)
    {
        if(response) // If they clicked 'Yes' or pressed enter
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've healed yourself");
            SetPlayerHealth(playerid, 100.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've added VIP armor to yourself");
            SetPlayerArmour(playerid, 100.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've got a weaponset");
            GivePlayerWeapon(playerid, 31, 100); //M4 with 100 bullts
            //Add the rest of your guns here blah blah
        }
        return 1;
    }

    return 0;
}



Re: Please Help me about "VIP LOCKER" - ChuckyBabe - 14.03.2014

@Flake here
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == VIP_DIALOG)
    {
        if(response) // If they clicked 'Yes' or pressed enter
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've healed yourself");
            SetPlayerHealth(playerid, 100.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've added VIP armor to yourself");
            SetPlayerArmour(playerid, 100.0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "You've got a weaponset");
            GivePlayerWeapon(playerid, 31, 100); //M4 with 100 bullts
            //Add the rest of your guns here blah blah
        }
        return 1;
    }

    return 0;
}
ah how if he choose list item no. 2 he will get armor ? i'am curious why your code doesn't have any list item etc..