16.02.2015, 20:12
So heres a code. Its a command that lets player A to sell something to player B.
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
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:
case D_Tuning+29:
{
if(response)
{
new playered = GetPVarInt(playerid, "Someone");
new CPrice = inputtext[0];
format(string, 200, "Would you like to buy this and that from %s for %s....?", sendername(playerid),CPrice);
ShowPlayerDialog(playered, D_Tunings+30, 1, "Selection", string, "yes", "No");
return 1;
}
}
CMD:onetwothree(playerid, params[])
{
format(string, 200, "Insert the amount of cash you want to get for something...");
ShowPlayerDialog(playerid, D_Tunings+29, 1, "amount", string, "yes", "No");
SetPVarInt(params[0], "Someone", playerid);
return 1;
}
PHP Code:
ShowPlayerDialog(playered, D_Tunings+30, 1, "Selection", string, "yes", "No");
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(playered, D_Tunings+30, 1, "Selection", string, "yes", "No");