[Help] LARP Bank Script with Show Menu - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] LARP Bank Script with Show Menu (
/showthread.php?tid=112212)
[Help] LARP Bank Script with Show Menu -
alex1a - 06.12.2009
I already have the function of "ShowDialog" and "CheckPlayerPos. But now I wanted to build a script that comes close to the bank and it appeared the ShowDialog with the game options "Transfer" "Deposit" etc ...
And when loading one of them asked to enter the value you want to deposit or transfer.
This GameMode in the LARP
Thanks
Re: [Help] LARP Bank Script with Show Menu -
Rac3r - 06.12.2009
If you don't understand how to use the new DIALOG, you need to read this.
http://forum.sa-mp.com/index.php?topic=130286.0
Bascially, it would involve an INPUT DIALOG, for the money total.
DIALOG LIST, to hold the Deposit and Transfer options.
Trust me, get your head around the way DIALOGS work.
Re: [Help] LARP Bank Script with Show Menu -
alex1a - 06.12.2009
Thanks i will try
Re: [Help] LARP Bank Script with Show Menu -
alex1a - 06.12.2009
What comand i put? playermoney? giveplayer?
Код:
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /transfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /transfer [playerid/PartOfName] [amount]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s transferd $%d to %s", sendername, moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Re: [Help] LARP Bank Script with Show Menu -
alex1a - 06.12.2009
Or i need a input exemple script