05.07.2018, 12:34
I would recommend you this include for creating dialogs much simpler: https://sampforum.blast.hk/showthread.php?tid=475838
Also, checking for client-side money is a very bad idea, use server-sided. Else It can be easily hacked.
However, this should work:
Also, checking for client-side money is a very bad idea, use server-sided. Else It can be easily hacked.
However, this should work:
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1: // DIALOG ID. IT'S BETTER TO USE DEFINES IF YOU DON'T USE EASYDIALOG
{
if(response)
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "ERROR: You don't have enough cash.");
switch(lisitem)
{
case 0: // Listitem 1
{
// ..
}
case 1: // Listitem 2
{
// ..
}
}
}
}
return 1; // We handled a dialog, so return 1.
}
return 0; // You MUST return 0 here!
}