strings - 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: strings (
/showthread.php?tid=446050)
strings -
Josh_Main - 24.06.2013
Hello, this is my /buydrink command.
Код:
CMD:buydrink(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 28, 498.7181,-19.5918,1000.6797))
{
if(GetPlayerInterior(playerid) > 17)
{
new string[128]
format(string, sizeof(string), "%s approaches the bar, slipping some cash out of his pocket and placing it on the bench", GetPlayerName(playerid);
ShowPlayerDialog(playerid, DIALOGDRINKS, DIALOG_STYLE_LIST, "Hello, what can I get you today?","Smirnoff\nBombay\nGoon\nBeer\nRose\nWater\nSprunk","Buy drink","Cancel");
return 1;
}
}
return 0;
}
I would like to know what I add under...
Quote:
format(string, sizeof(string), "%s approaches the bar, slipping some cash out of his pocket and placing it on the bench", GetPlayerName(playerid);
|
to all of the players in that interior
Any help would be appreciated. Thank you
EDIT: Knowing that there are more then 1 club interiors in my server, I will have to set other clubs a different interior. if I'm using if(GetPlayerInterior(playerid) > 17) will this command also work in club interiors that I have changed the virtual world?
Re: strings -
iJumbo - 24.06.2013
pawn Код:
CMD:buydrink(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 28, 498.7181,-19.5918,1000.6797)) {
if(GetPlayerInterior(playerid) > 17) {
new string[128]
format(string, sizeof(string), "%s approaches the bar, slipping some cash out of his pocket and placing it on the bench", GetPlayerName(playerid);
for(new i = 0; i != MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(GetPlayerInterior(i) > 17) {
SendClientMessage(i,color,string);
}
}
}
ShowPlayerDialog(playerid, DIALOGDRINKS, DIALOG_STYLE_LIST, "Hello, what can I get you today?","Smirnoff\nBombay\nGoon\nBeer\nRose\nWater\nSprunk","Buy drink","Cancel");
return 1;
}
}
return 0;
}
you mean that?
Re: strings -
Josh_Main - 24.06.2013
Quote:
Originally Posted by iJumbo
pawn Код:
CMD:buydrink(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 28, 498.7181,-19.5918,1000.6797)) { if(GetPlayerInterior(playerid) > 17) { new string[128] format(string, sizeof(string), "%s approaches the bar, slipping some cash out of his pocket and placing it on the bench", GetPlayerName(playerid); for(new i = 0; i != MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(GetPlayerInterior(i) > 17) { SendClientMessage(i,color,string); } } } ShowPlayerDialog(playerid, DIALOGDRINKS, DIALOG_STYLE_LIST, "Hello, what can I get you today?","Smirnoff\nBombay\nGoon\nBeer\nRose\nWater\nSprunk","Buy drink","Cancel"); return 1; } } return 0; }
you mean that?
|
If that broadcasts the string to all the players in that interior, that's it
Re: strings -
iJumbo - 24.06.2013
Note broadcast the string to all player in interior bigger than 17 if you want only in 17 put == instead of >