PDA

View Full Version : PickUp


lsreskjn
22/09/2013, 03:57 PM
Hey, i am not sure how to use dialog if player pickup a pickup so here is what i have done and please if you have time make it right, thanks

new Bankomat;

//////////////////////////Bankomat
Bankomat = CreatePickup(1212, 1, 1942.0297,-2361.3611,13.5469);


if(pickupid == Bankomat)
{
GetPlayerIp(playerid, ip2, sizeof(ip2));
ShowPlayerDialog(playerid, Bankomat, DIALOG_STYLE_LIST, "Cash Machine", "Account name: %s\nAccount number: %s\nBalance: $%d\n", "OK", "OK",Jmeno(playerid), GetPlayerIpEx(playerid), GetPlayerMoney(playerid));




return 1;
}

DanishHaq
22/09/2013, 03:58 PM
What's the problem? It looks fine to me. Make sure you have the last code under OnPlayerPickupPickup.

lsreskjn
22/09/2013, 03:59 PM
it is on public OnPlayerPickUpPickup(playerid, pickupid)

Skimmer
22/09/2013, 04:00 PM
First of all you cannot use pickupid as Dialog ID and second the GetPlayerIp function is useless there.

// Top of the script
#define DIALOG_BANK (55) // The ID of the Dialog I choice 55, you're allowed to change it


if(pickupid == Bankomat)
{
ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "Cash Machine", "Account name: %s\nAccount number: %s\nBalance: $%d\n", "OK", "OK",Jmeno(playerid), GetPlayerIpEx(playerid), GetPlayerMoney(playerid));
return 1;
}

lsreskjn
22/09/2013, 04:03 PM
still the same errors

warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition

Skimmer
22/09/2013, 04:12 PM
Ah, and you cannot format a text inside a Dialog.

new str[158];
format(str, sizeof(str), "Cash Machine", "Account name: %s\nAccount number: %s\nBalance: $%d\n", Jmeno(playerid), GetPlayerIpEx(playerid), GetPlayerMoney(playerid));
ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, str, "OK", "");

lsreskjn
22/09/2013, 04:12 PM
This one is working for me now :D

if(pickupid == Bankomat)
{


new strin[400];
GetPlayerIp(playerid, ip2, sizeof(ip2));
GetPlayerPing(playerid);

format(strin,sizeof(strin),"{990099}===============Account Information===============\n\n",strin);
format(strin,sizeof(strin),"%s{FFFFFF}Account name: {990099}%s\n{FFFFFF}Account number: {990099}%s\n{FFFFFF}Balance: {990099}$%d\n",strin,Jmeno(playerid),GetPlayerIpEx(playerid),Get PlayerMoney(playerid));
ShowPlayerDialog(playerid,500,DIALOG_STYLE_MSGBOX,"INFO",strin,"Zavriet","");

return 1;
}