SA-MP Forums Archive
console? - 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: console? (/showthread.php?tid=113130)



console? - Lajko1 - 12.12.2009

Guys i seen on some server there are consoles how i can make console ?

Like:

-----------------------------------------
Tazer $8000
Gun Locker $13000
Desert Eagle 30 Bullets $2000
Shotgun 20 Bullets $3500

>BUY< >Cancel<
-----------------------------------------

How Is Possible To Make That Can u Help Me Pelase ?

Ty For Any Help



Re: console? - SloProKiller - 12.12.2009

Use ShowPlayerDialog


Re: console? - Lajko1 - 12.12.2009

how i can use this ? o.O


Re: console? - saiberfun - 12.12.2009

Quote:
Originally Posted by Lajko1
how i can use this ? o.O
https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: console? - Lajko1 - 12.12.2009

oky ty but i have 1 more question now i made when palyer enter checkpoint it will show him dialog so my dialog looks like this

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
	if(streamid == CopSaleCP)
	{
	  new string[256];
	  new playername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
		
		format(string,sizeof(string),"Tazer                    $25000",playername);
		ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Welcome Officer! Anything For You?",string,"Buy","Cancel");
	  return 1;
	}
  return 1;
}
using checkpoint streamer thanks to ''Dragsta''

amm how i can make the i wrote ''Welcome Officer!'' but i want if is possible ''Welcome Officer (his name)" is that possible ? i think it is
and if is possible can u tell me how to make that, i try with ''Welcome Officer %s'' but it wont work...

so how i can make now when player wanan buy tazer he will get -25k and get a tazer ? idk like ''HaveTazer = 1'' - should be in code,so than he can use command /taze (id)

so as i tell i want when player buy ''Tazer'' he get -25000$ and if he dont have 25000 he get message ''Not Enough Money!''

how i can make this ?

Ty For Any Help!


Re: console? - Lajko1 - 12.12.2009

cmon guys help please


Re: console? - MJ! - 12.12.2009

pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
    if(streamid == CopSaleCP)
    {
      new string[256],string2[128];
      new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
        format(string2,sizeof string2,"Welcome Officer %s ! Anything for You ?",playername);
        format(string,sizeof(string),"Tazer                    $25000",playername);
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,string2,string,"Buy","Cancel");
      return 1;
    }
  return 1;
}




Re: console? - MJ! - 12.12.2009

Quote:
Originally Posted by Lajko1
oky ty but i have 1 more question now i made when palyer enter checkpoint it will show him dialog so my dialog looks like this

Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
	if(streamid == CopSaleCP)
	{
	  new string[256];
	  new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);		
	format(string,sizeof(string),"Tazer                   $25000",playername);
	ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Welcome Officer! Anything For You?",string,"Buy","Cancel");
	  return 1;
	}
  return 1;
}
using checkpoint streamer thanks to ''Dragsta''

amm how i can make the i wrote ''Welcome Officer!'' but i want if is possible ''Welcome Officer (his name)" is that possible ? i think it is
and if is possible can u tell me how to make that, i try with ''Welcome Officer %s'' but it wont work...

so how i can make now when player wanan buy tazer he will get -25k and get a tazer ? idk like ''HaveTazer = 1'' - should be in code,so than he can use command /taze (id)

so as i tell i want when player buy ''Tazer'' he get -25000$ and if he dont have 25000 he get message ''Not Enough Money!''

how i can make this ?

Ty For Any Help!



Re: console? - Lajko1 - 12.12.2009

TY! And What About when i want to buy Tazer ? how To Do this when i buy it i can use command /taze if i dont ahve tazer i cant use this command /taze,can anyone help me with this please ?

Ty for any help


Re: console? - MJ! - 12.12.2009

pawn Код:
new bool: Tazer[MAX_PLAYERS];
pawn Код:
public OnPlayerEnterStreamedCheckpoint(playerid, streamid)
{
      if(streamid == CopSaleCP)
      {
        new string[256],string2[128];
        new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
            format(string2,sizeof string2,"Welcome Officer %s ! Anything for You ?",playername);
            format(string,sizeof(string),"Tazer\t\t\t\t\t\t\t\t\t\t\t\b$25000",playername);
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,string2,string,"Buy","Cancel");
        return 1;
      }
  return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 2 && response)
  {
     _:Tazer[playerid] = true;
     SendClientMessage(playerid,0xFFFFFFAA,"You can use now /tazer.");
  }
  return 1;
}
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
  if(!strcmp(cmdtext,"/tazer",true))
  {
    if(_:Tazer[playerid] == false) return 1;
    // rest of code
  }
}