important-agent-12277
04/13/2023, 7:43 PMflat-egg-44689
04/13/2023, 7:49 PMp2? You declare it, but never assign anything to it.gorgeous-tomato-73021
04/13/2023, 8:34 PMgorgeous-tomato-73021
04/13/2023, 8:35 PMimportant-agent-12277
04/13/2023, 9:20 PMimportant-agent-12277
04/13/2023, 10:24 PMpublic OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == KEY_CTRL_BACK))
{
format(str, sizeof(str), "Money: \t\t {00FF7F}$%i{FFFFFF}", backMoney(playerid));
ShowPlayerDialog(playerid, 613, DIALOG_STYLE_LIST, "Bag", str, "Send", "End");
}
}
OnDialogResponse...
if(dialogid == 613)
{
new str[140], p2;
if(response)
{
if(listitem == 0)
{
if(GetDistanceBetweenPlayers(playerid, p2) < 10)
{
format(str, sizeof(str), "{00FF7F}[MONEY]{FFFFFF} How much do you want to transfer to %s?", NameP(p2));
ShowPlayerDialog(playerid, 630, DIALOG_STYLE_INPUT, "MONEY", str, "Enviar", "Cancelar");
}
else
{
}
}
}
If I try to use a loop to identify nearby players, it returns my own ID. As if I had to define that my ID would not count in this loop.
For example:
for(new i; i < MAX_PLAYERS; i++)
{
if(GetDistanceBetweenPlayers(playerid, i) < 10)
{
format(str, sizeof(str), "{00FF7F}[MONEY]{FFFFFF} How much do you want to transfer to %s?", NameP(i));
ShowPlayerDialog(playerid, 630, DIALOG_STYLE_INPUT, "Send Money", str, "Send", "End");
}
}gorgeous-tomato-73021
04/13/2023, 11:48 PMgorgeous-tomato-73021
04/13/2023, 11:48 PMgorgeous-tomato-73021
04/13/2023, 11:49 PMimportant-agent-12277
04/14/2023, 3:17 AMnew playerTrade[MAX_PLAYERS];
new IDplayer;
if(sscanf(params, "i", IDplayer)) return SCM(playerid, -1,"{FF4500}Use: /command [id].");
playerTrade[IDplayer] = playerid;
And so use playerTrade[playerid] to characterize who used the command.
The problem is that the OnDialogResponse callback doesn't have params[], and I don't know how I can work around it..gorgeous-tomato-73021
04/14/2023, 10:13 AM