[HELP]Dialogs - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Dialogs (
/showthread.php?tid=306652)
[HELP]Dialogs -
eemalekorraks - 27.12.2011
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, -30.4957, -55.6401, 1003.5469, 3.0);
return 1;
}
Creates a Checkpoint inside a 24/7 In Los Santos
Код:
public OnPlayerEnterCheckpoint(playerid)
{
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Shop","\nMP3 Player","Buy","Cancel");
return 1;
}
The shop Dialog
Код:
if(dialogid == 7 && response)
{
switch(listitem)
{
case 0:
{
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, COLOR_YELLOW, "You bought an mp3 player");
}
}
}
Now heres the catch I want to make it like this that if a player does not have 1000 dollars it says so and a player cannot buy it.
And if a player already has it it would say
Код:
SendClientMessage(playerid, COLOR_YELLOW, "Already Have an MP3 Player");
Thanks in Advance
Re: [HELP]Dialogs -
§с†¶e®РµРe - 27.12.2011
create a variable and make it default as 0.If a player buys a mp3 change it to 1.And if he clicks on buy if the variable is 1 SendClientMesssage or make the variable 1.And then do whatever u want to
Re: [HELP]Dialogs -
eemalekorraks - 27.12.2011
I tried but I don't exactly know how to add it to the code.
i made
new mp3;
then under the buying part I don't know how to write the code there.
Im still an beginner scripter
Re: [HELP]Dialogs -
eemalekorraks - 28.12.2011
bump
Re: [HELP]Dialogs -
ZmaXy - 28.12.2011
pawn Код:
SetPVarInt(playerid,"MP3", 1);
pawn Код:
if(GetPVarInt(playerid,"MP3") != 1) return SendClientMessage(playerid, COLOR_YELLOW, "Already Have an MP3 Player");
Re: [HELP]Dialogs -
Andi_Evandy - 29.12.2011
try this:
(The Shop Dialog)
pawn Код:
if(dialogid == 7 && response)
{
switch(listitem)
{
case 0:
{
if(GetPVarInt(playerid,"HaveMP3") == 1) return SendClientMessage(playerid, -1, "{FF0000}You already have a MP3 player");
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, -1, "{FF0000}You don't have $1000 to buy a mp3 player");
GivePlayerMoney(playerid, -1000);
SendClientMessage(playerid, COLOR_YELLOW, "You bought a MP3 player");
SetPVarInt(playerid,"HaveMP3",1);
}
}
}