Problem with PVars
#1

So heres a code. Its a command that lets player A to sell something to player B.

PHP Code:
        case D_Tuning+29:
        {
            if(
response)
            {
                new 
playered GetPVarInt(playerid"Someone");
                new 
CPrice inputtext[0];
                
format(string200"Would you like to buy this and that from %s for %s....?"sendername(playerid),CPrice);
                
ShowPlayerDialog(playeredD_Tunings+301"Selection"string"yes""No");
                return 
1;
            }
        }
        
        
CMD:onetwothree(playeridparams[])
{
        
format(string200"Insert the amount of cash you want to get for something...");
        
ShowPlayerDialog(playeridD_Tunings+291"amount"string"yes""No");
        
SetPVarInt(params[0], "Someone"playerid);
    return 
1;

So what i was trying to do there is, after the command "onetwothree is called, player A chooses how much cash he wants to get, and the system is supposed to set PVar on player B so that i can use player B inside my dialogs. So in dialogs playered is ment to be the player B, but somehow it displays it as player A

PHP Code:
                ShowPlayerDialog(playeredD_Tunings+301"Selection"string"yes""No"); 
It displays this code to player A not player B altho it should display it to player B.

Also, im struggling to set the input from the dialog to variable. After player A makes the choice how much cash he would like to get for this thing, the price gets saved to variable CPrice. But after trying to display it in the string, it prints just the first number.... Lets say, if i chose to sell something for 4000 euros, it would only display the 4.... Speaking abt this line:
PHP Code:
                ShowPlayerDialog(playeredD_Tunings+301"Selection"string"yes""No"); 
Reply


Messages In This Thread
Problem with PVars - by GuitarMan - 16.02.2015, 20:12
Re: Problem with PVars - by xVIP3Rx - 16.02.2015, 20:19
Re: Problem with PVars - by GuitarMan - 16.02.2015, 20:28
Re: Problem with PVars - by xVIP3Rx - 16.02.2015, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)