[AJUDA]Alguem ajuda aki pf, rs '
#1

Tipo galera boa noite/boa tarde/bom dia depende da hr que vc irб ler, venho aki pedir a ajuda de algumas pessoas que saibao passar de dialog para texto normal,

tipo eu digito /rcmds ai aparece os comandos que tem em dialog sу que quero passar esses cmd para aparecer em textos comuns na tela,

vim pedir a ajuda de vcs pois nem pwn basico sou sу sei dar uma zuada no pwn, ou seja quem poder ajudar agradeзo, quem nгo poder/pode agradeзo do mesmo jeito por ter vindo aqui ler pelo menos


brigadгo a todos!

PHP код:
if(strcmp(cmd"/rcmds"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        if(
arbitro[playerid] == 1)
        {
        
format(stringsizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin"squadra1squadra2);
        
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Referee Commands"string"Select""Exit");
        }
        }return 
1;
        }
        return 
0;

Reply
#2

string jб estб no ponto de ser usada, pois jб passou pelo format.
Portanto, se bem entendi o que vocк quer, й sу tirar o ShowPlayerDialog e coloca isso no lugar.

pawn Код:
SendClientMessage(playerid,-1,string);
pawn Код:
if(strcmp(cmd, "/rcmds", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(arbitro[playerid] == 1)
        {
            format(string, sizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin", squadra1, squadra2);
            SendClientMessage(playerid,-1,string);
        }
    }
    return 1;
}
Ps: \n , que й usado para pular linhas nгo vai funcionar no SendClientMessage.
Reply
#3

pawn Код:
if(strcmp(cmd, "/rcmds", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(arbitro[playerid] == 1)
        {
            format(string, sizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin", squadra1, squadra2);
            ShowPlayerDialog(playerid,1554, DIALOG_STYLE_MSGBOX, ".:: RCMDS ::.", string, "Ok","Sair");
        }
    }
    return 1;
}
OnDialogResponse

pawn Код:
if(dialogid == 1554)
{
      if(response) return 1;
      if(!response) return 1;
}
Reply
#4

Gente desculpe por demorar a responder mais eu mesmo me confudi desculpe ;s

tipo a fs йra em dialog eu digita o cmd ai eu escolhia o comando e executava e como ja disse acima nao sei muita coisa sobre pwn tipo eu queria passar ela para comando digitavel por exemplo /rcmds ai tinha a lista eu escolhia end match ai acaba a partida eu queria que esse end match e os demais cmds fossem passados para cmds digitaveis se alguem poder fazer isso estou upando a fs no 4shared
Reply
#5

Posso tentar te ajudar, posta ai.
Reply
#6

PHP код:
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#include <dini>
#define FILTERSCRIPT
#define COLOR_DARKBLUE 0x0000D0FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0xBBFFFFFF
#define COLOR_BLACK 0x000000FF
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GROVE 0x00FF00FF
forward KeyChanges();
forward PlayerToPoint(Float:radiplayeridFloat:xFloat:yFloat:z);
forward ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5);
forward SafeGivePlayerMoney(plyidamounttogive);
forward CustomPickups();
forward MetalDetector(playerid);
forward AntiInvasione();
new 
giocatore[MAX_PLAYERS];
new 
arbitro[MAX_PLAYERS];
new 
stuart[MAX_PLAYERS];
new 
fumogeno[MAX_PLAYERS];
new 
biglietto[MAX_PLAYERS];
new 
spettatore[MAX_PLAYERS];
new 
allenamento[MAX_PLAYERS];
new 
squadra1[60] = "Team1";
new 
squadra2[60] = "Team2";
new 
goal1 0;
new 
goal2 0;
new 
annunciata 0;
new 
skin[MAX_PLAYERS];
new 
palla;
new 
object1;
new 
object2;
new 
object3;
new 
object4;
new 
object5;
new 
object6;
new 
object7;
new 
object8;
new 
object9;
new 
object10;
new 
object11;
new 
object12;
new 
object13;
new 
object14;
new 
object15;
new 
object16;
new 
object17;
new 
object18;
new 
object19;
new 
object20;
new 
object21;
new 
object22;
new 
object23;
new 
object24;
new 
object25;
new 
object26;
new 
object27;
new 
object28;
new 
object29;
new 
object30;
new 
object31;
new 
object32;
new 
object33;
new 
object34;
new 
object35;
new 
object36;
new 
object37;
new 
object38;
new 
object39;
new 
object40;
new 
object41;
new 
object42;
new 
object43;
new 
object44;
new 
object45;
new 
object46;
new 
object47;
new 
object48;
new 
object49;
new 
object50;
new 
object51;
new 
object52;
new 
object53;
#if defined FILTERSCRIPT
main()
{
}
public 
OnPlayerConnect(playerid)
{
giocatore[playerid] = 0;
arbitro[playerid] = 0;
stuart[playerid] = 0;
fumogeno[playerid] = 0;
biglietto[playerid] = 0;
spettatore[playerid]= 0;
skin[playerid] = 0;
allenamento[playerid] = 0;
SetTimerEx("KeyChanges"1001"i"playerid);
SetTimer("AntiInvasione"10001);
SendClientMessage(playeridCOLOR_DARKBLUE"This server uses Football Filterscript created by Giuseppe Mazzei");
//do NOT remove credits, if you want you can add:
//SendClientMessage(playerid, COLOR_DBLUE, "Modified by [your name]");
}
public 
OnFilterScriptInit()
{
print(
"|_________Football Filterscript__________|");
print(
"|______Created By Giuseppe_Mazzei________|");
print(
"|_______________Loaded___________________|");
object1 CreateObject(3452, -151.817719, -32.3928997.8416120.00000.000067.5000);
object2 CreateObject(3452, -140.492004, -5.0262147.8416120.00000.000067.5000);
object3 CreateObject(3452, -218.382690, -6.7879297.8416120.00000.0000247.5000);
object4 CreateObject(3452, -207.17491120.4355227.8416120.00000.0000247.5000);
object5 CreateObject(3452, -161.06341640.9566127.8416120.00000.0000157.5000);
object6 CreateObject(3452, -197.899384, -52.9075097.8416120.00000.0000337.5000);
object7 CreateObject(3453, -135.33715824.3736887.8416110.00000.000067.5000);
object8 CreateObject(3453, -190.54266446.2795727.8416110.00000.0000157.5000);
object9 CreateObject(3453, -223.720779, -36.3000377.8416110.00000.0000247.5000);
object10 CreateObject(3453, -168.429810, -58.2018287.8416110.00000.0000337.5000);
object11 CreateObject(10954, -182.091522, -11.98584418.4000000.00000.0000247.5000);
object12 CreateObject(6063, -182.162048, -109.8045969.0069530.00000.0000258.7500);
object13 CreateObject(3660, -187.470535, -159.8059545.0991540.00000.0000348.7500);
object14 CreateObject(7306, -153.59263647.82925816.3304670.00000.000022.5000);
object15 CreateObject(7307, -203.894562, -60.22494916.4276980.00000.0000112.5001);
object16 CreateObject(4639, -222.447067, -84.8414543.8137670.00000.0000337.5000);
object17 CreateObject(17037, -166.01602226.2440954.6086620.00000.000067.5000);
object18 CreateObject(17037, -194.827393, -40.7638094.6086620.00000.0000247.5000);
object19 CreateObject(3819, -208.973663, -14.2709163.1149480.00000.0000157.5000);
object20 CreateObject(3819, -197.34994514.6211973.1149460.00000.0000157.5000);
object21 CreateObject(14485, -155.380585, -141.228271, -0.5584190.00000.000090.0000);
object22 CreateObject(14387, -186.612839, -126.8122713.1012990.00000.000090.0000);
object23 CreateObject(1508, -184.073410, -115.5477983.7795780.00000.00000.0000);
object24 CreateObject(1508, -183.999069, -136.2258005.7407830.00000.0000270.0000);
object25 CreateObject(8332, -197.508453, -122.9878926.4051750.00000.000090.0000);
object26 CreateObject(7592, -198.4932404.0743042.6700100.00000.0000337.5000);
object27 CreateObject(7592, -159.629807, -13.3740392.6778040.00000.0000337.5000);
object28 CreateObject(7592, -166.53842224.2213022.6778050.00000.0000247.5000);
object29 CreateObject(7592, -186.473572, -42.1122742.6778040.00000.0000247.5000);
object30 CreateObject(10397, -179.837433, -6.6909836.0427990.00000.0000247.5000);
object31 CreateObject(3114, -224.517517, -11.73214214.0000000.00000.0000247.5000);
object32 CreateObject(3114, -216.4464117.76344314.0000000.00000.0000247.5000);
object33 CreateObject(3114, -208.36793527.25038114.0000000.00000.0000247.5000);
object34 CreateObject(7614, -241.21286048.8563843.6903080.00000.0000337.5000);
object35 CreateObject(8040, -244.76760924.9448242.2430170.00000.0000247.5000);
object36 CreateObject(978, -264.232971, -9.8653142.3176120.00000.0000157.5000);
object37 CreateObject(8042, -259.987183, -11.0322957.3524110.00000.0000258.7501);
object38 CreateObject(979, -263.734314, -6.8658852.3176140.00000.0000337.5000);
object39 CreateObject(986, -188.26113941.5968636.8725910.00000.0000303.7500);
object40 CreateObject(986, -191.22361845.9652068.6145510.00000.0000303.7500);
object41 CreateObject(986, -194.79893551.25720210.3415340.00000.0000303.7500);
object42 CreateObject(986, -139.86920222.5097586.8725910.00000.0000202.5000);
object43 CreateObject(986, -134.51226824.6954088.6069660.00000.0000202.5000);
object44 CreateObject(986, -129.53324926.87395310.3415340.00000.0000202.5000);
object45 CreateObject(986, -219.514694, -33.2179686.8725910.00000.000022.5000);
object46 CreateObject(986, -223.991638, -35.0549138.6145500.00000.000022.5000);
object47 CreateObject(986, -230.190796, -37.6620839.9116540.00000.000022.5000);
object48 CreateObject(986, -171.166641, -53.6541826.8725910.00000.0000101.2500);
object49 CreateObject(986, -169.950790, -59.8466348.6145500.00000.0000101.2500);
object50 CreateObject(986, -168.824356, -65.59204910.3491540.00000.0000101.2500);
object51 CreateObject(7613, -201.964142, -88.0570303.5162960.00000.0000247.5000);
object52 CreateObject(10955, -181.623108, -11.51902815.7781450.00000.0000247.5000);
object53 CreateObject(7306, -138.546173, -23.99972716.2753850.00000.0000292.5000);
palla CreateObject(1598, -180.464828, -7.4257052.4143980.00000.00000.0000);
AddStaticPickup(12392, -222.5425,-86.7066,3.1172);//biglietteria
AddStaticPickup(12392, -202.9730,-66.6648,3.3062);//ingresso stadio
AddStaticPickup(12392, -195.1585,-100.0893,3.1163);//ingresso sala stampa
AddStaticPickup(12392, -184.8640,-114.0260,3.1213);//uscita sala stampa
AddStaticPickup(12392, -182.5193,-135.1851,5.0900);//ingresso spogliatoio
AddStaticPickup(12392, -210.6958,-3.7785,3.1094);//campo
SetTimer("CustomPickups"10001);
return 
1;
}
public 
OnFilterScriptExit()
{
DestroyObject(palla);
DestroyObject(object1);
DestroyObject(object2);
DestroyObject(object3);
DestroyObject(object4);
DestroyObject(object5);
DestroyObject(object6);
DestroyObject(object7);
DestroyObject(object8);
DestroyObject(object9);
DestroyObject(object10);
DestroyObject(object11);
DestroyObject(object12);
DestroyObject(object13);
DestroyObject(object14);
DestroyObject(object15);
DestroyObject(object16);
DestroyObject(object17);
DestroyObject(object18);
DestroyObject(object19);
DestroyObject(object20);
DestroyObject(object21);
DestroyObject(object22);
DestroyObject(object23);
DestroyObject(object24);
DestroyObject(object25);
DestroyObject(object26);
DestroyObject(object27);
DestroyObject(object28);
DestroyObject(object29);
DestroyObject(object30);
DestroyObject(object31);
DestroyObject(object32);
DestroyObject(object33);
DestroyObject(object34);
DestroyObject(object35);
DestroyObject(object36);
DestroyObject(object37);
DestroyObject(object38);
DestroyObject(object39);
DestroyObject(object40);
DestroyObject(object41);
DestroyObject(object42);
DestroyObject(object43);
DestroyObject(object44);
DestroyObject(object45);
DestroyObject(object46);
DestroyObject(object47);
DestroyObject(object48);
DestroyObject(object49);
DestroyObject(object50);
DestroyObject(object51);
DestroyObject(object52);
DestroyObject(object53);
}
#else
main()
{
        print(
" Football Stadium [FS] LOADED");
}
#endif
strtok(const string[], &index)
{
        new 
length strlen(string);
        while ((
index length) && (string[index] <= ' '))
        {
                
index++;
        }
        new 
offset index;
        new 
result[20];
        while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
        {
                
result[index offset] = string[index];
                
index++;
        }
        
result[index offset] = EOS;
        return 
result;
}
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:yFloat:distance)
{
        new 
Float:a;
        
GetPlayerPos(playeridxya);
        
GetPlayerFacingAngle(playerida);
        if (
GetPlayerVehicleID(playerid))
        {
            
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
        }
        
+= (distance floatsin(-adegrees));
        
+= (distance floatcos(-adegrees));
}
public 
CustomPickups()
{
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        for(new 
0MAX_PLAYERSi++)
        {
                if(
IsPlayerConnected(i))
                {
                        
GetPlayerPos(ioldposxoldposyoldposz);
                        if (
PlayerToPoint(1.7i, -222.5425,-86.7066,3.1172))
                        {
//biglietteria
                         
GameTextForPlayer(i"~g~Tikets,~n~~y~press the key to ~r~RUN~y~~n~~w~to buy somthing"50003);
                        }
                        else if (
PlayerToPoint(1.7i, -202.9730,-66.6648,3.3062))
                        {
//entrata allo stadio
                         
GameTextForPlayer(i"~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter"50003);
                        }
                        else if(
PlayerToPoint(1.7i, -195.1585,-100.0893,3.1163))
                        {
//ingresso sala stampa
                        
SetPlayerPos(i, -186.7655,-116.7739,3.1213);
                        
GameTextForPlayer(i"~g~Newsroom"50001);
                        }
                        else if(
PlayerToPoint(1.7i, -184.8640,-114.0260,3.1213))
                        {
//uscita sala stampa
                        
SetPlayerPos(i, -199.5605,-99.5375,3.1163);
                        
GameTextForPlayer(i"~r~Exit"50001);
                        }
                        else if(
PlayerToPoint(1.7i, -210.6958,-3.7785,3.1094))
                        {
//uscita dal campo
                        
GameTextForPlayer(i"~g~Exit~n~~y~press the key to ~r~RUN~y~~n~~w~to go out"50003);
                        }
                        else if(
PlayerToPoint(1.7i, -182.5193,-135.1851,5.0900))
                        {
//ingresso in campo
                        
if(annunciata == 1)
                        {
                        if(
arbitro[i] == || giocatore [i] >= || stuart[i] == 1)
                        {
                        
GameTextForPlayer(i"~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter"50003);
                        }
                        else
                        {
                        
GameTextForPlayer(i"~r~You can not enter"50001);
                        }
                        }
                        else
//annunciata == 0
                        
{
                        if(
arbitro[i] == 1)
                        {
                        
GameTextForPlayer(i"~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to enter"50003);
                        }
                        else
                        {
                        
GameTextForPlayer(i"~g~Entrance~n~~y~press the key to ~r~RUN~y~~n~~w~to start training"50003);
                        }
                        }
                        }
                        }
                }
        }
public 
KeyChanges()
{
    new 
keysupdownleftright;
    new 
string[256];
    for(new 
playerid 0playerid MAX_PLAYERSplayerid++)
    {
        if(
IsPlayerConnected(playerid))
        {
        
GetPlayerKeys(playeridkeysupdownleftright);
        new 
Float:oxFloat:oyFloat:oz;
        
GetObjectPos(pallaoxoyoz);
        new 
Float:pxFloat:pyFloat:pz;
        new 
Float:angle;
        
GetPlayerFacingAngle(playeridangle);
        if(
keys == KEY_FIRE && giocatore[playerid] >= || keys == KEY_FIRE && allenamento[playerid] >= 1)
                            {
                                if(
PlayerToPoint(2.5,playerid,ox,oy,oz))
                                {
                                
GetPlayerPos(playeridpxpypz);
                                
GetXYInFrontOfPlayer(playeridpxpy10.0);
                                
MoveObject(palla,px,py,2.414398,8.0);
                                
PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
                                
ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
                                }
                                }
    else if(
keys == KEY_FIRE KEY_SPRINT && giocatore[playerid] >= || keys == KEY_FIRE KEY_SPRINT && allenamento[playerid] >= 1)
                            {
                            if(
PlayerToPoint(2.5,playerid,ox,oy,oz))
                                {
                                
GetPlayerPos(playeridpxpypz);
                                
GetXYInFrontOfPlayer(playeridpxpy10.0);
                                
MoveObject(palla,px,py,2.414398,10.0);
                                
PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
                                
ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
                        }
                        }
        else if(
keys == KEY_SPRINT && PlayerToPoint(1.7playerid, -222.5425,-86.7066,3.1172))
                        {
                        if(
annunciata == 1)
                        {
                        
ShowPlayerDialog(playerid13DIALOG_STYLE_LIST"Tickets - Choose what you want to buy""Ticket\nSmoker $30""Seleziona""Cancella");
                        }
                        else
                        {
                
GameTextForPlayer(playerid"~r~Closed"50001);
                
PlayerPlaySound(playerid11450.00.00.0);
                return 
1;
                }
                }
        else if(
keys == KEY_SPRINT && PlayerToPoint(1.7playerid, -182.5193,-135.1851,5.0900))
                        {
//ingresso in campo
                        
if(annunciata == 1)
                        {
                        if(
arbitro[playerid] == || giocatore [playerid] >= || stuart[playerid] == 1)
                        {
                        
SetPlayerPos(playerid, -210.6958,-3.7785,3.1094);
                        }
                        }
                        else
//annunciata == 0
                        
{
                        if(
arbitro[playerid] == 1)
                        {
                        
SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
                        }
                        else
                        {
                        
SetPlayerPos(playerid, -204.9500,-5.2410,3.1094);
                        
allenamento[playerid] = 1;
                        }
                        }
                        }
//sono
        
else if(keys == KEY_SPRINT && PlayerToPoint(1.7playerid, -210.6958,-3.7785,3.1094))
        {
        if(
spettatore[playerid] != 1)
        {
        if(
allenamento[playerid] == 1)
        {
        
SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
        
SendClientMessage(playeridCOLOR_WHITE"Finish training");
        
allenamento[playerid] = 0;
        }
        else
        {
        
SetPlayerPos(playerid, -183.8667,-131.6020,5.0900);
        }
        }
        }
    else if(
keys == KEY_SPRINT && PlayerToPoint(1.7playerid, -202.9730,-66.6648,3.3062))
                        {
                        if(
biglietto[playerid] == 1)
                        {
                        
SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
biglietto[playerid] = 0;
                        
spettatore[playerid] = 1;
                        
MetalDetector(playerid);
                        }
                        else if(
biglietto[playerid] == 2)
                        {
                
SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
biglietto[playerid] = 0;
                        
spettatore[playerid] = 1;
                        
MetalDetector(playerid);                }
                else if(
biglietto[playerid] == 3)
                        {
                
SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
biglietto[playerid] = 0;
                        
spettatore[playerid] = 1;
                        
MetalDetector(playerid);                }
                else if(
biglietto[playerid] == 4)
                        {
                
SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
biglietto[playerid] = 0;
                        
spettatore[playerid] = 1;
                        
MetalDetector(playerid);
                }
                else if(
biglietto[playerid] == && stuart[playerid]== 1)
                {
                
format(stringsizeof(string), "grandstand\ndiscovery platform\ncurve fans %s\ncurve fans %s"squadra1squadra2);
                
ShowPlayerDialog(playerid15DIALOG_STYLE_LIST"Stuart Entrance - Choose where to go"string"Select""Delete");
                }
                else
                {
                
SendClientMessage(playeridCOLOR_WHITE"You don't have a ticket!");
                return 
1;
                }
                }
                }
        }return 
1;
}
public 
MetalDetector(playerid)
{
new 
ammo,weap;
GetPlayerWeaponData(playerid8,weap,ammo);
if (
weap == 17 && ammo >= 1)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid171);
}
else
{
ResetPlayerWeapons(playerid);
}
}
public 
AntiInvasione()
{
for(new 
0MAX_PLAYERSi++)
{
if(
spettatore[i] == 1)
{
new 
Float:XFloat:YFloat:Z;
GetPlayerPos(iXYZ);
if(
|| 12)
{
SetPlayerPos(i, -202.9730,-66.6648,3.3062);
spettatore[i] = 0;
GameTextForPlayer(i"~r~Exit"50001);
}
}
}
}
public 
SafeGivePlayerMoney(plyidamounttogive)
{
        new 
curHourcurMinutecurSecond;
        
gettime(curHourcurMinutecurSecond);
        if (
amounttogive 0)
        {
                
GivePlayerMoney(plyidamounttogive);
        }
        else
        {
                
GivePlayerMoney(plyidamounttogive);
        }
        return 
1;
}
public 
ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
{
        if(
IsPlayerConnected(playerid))
        {
                new 
Float:posxFloat:posyFloat:posz;
                new 
Float:oldposxFloat:oldposyFloat:oldposz;
                new 
Float:tempposxFloat:tempposyFloat:tempposz;
                
GetPlayerPos(playeridoldposxoldposyoldposz);
                
//radi = 2.0; //Trigger Radius
                
for(new 0MAX_PLAYERSi++)
                {
                        if(
IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
                        {
                                        
GetPlayerPos(iposxposyposz);
                                        
tempposx = (oldposx -posx);
                                        
tempposy = (oldposy -posy);
                                        
tempposz = (oldposz -posz);
                                        
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                                        
if (((tempposx radi/16) && (tempposx > -radi/16)) && ((tempposy radi/16) && (tempposy > -radi/16)) && ((tempposz radi/16) && (tempposz > -radi/16)))
                                        {
                                                
SendClientMessage(icol1string);
                                        }
                                        else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                                        {
                                                
SendClientMessage(icol2string);
                                        }
                                        else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                                        {
                                                
SendClientMessage(icol3string);
                                        }
                                        else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                                        {
                                                
SendClientMessage(icol4string);
                                        }
                                        else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                                        {
                                                
SendClientMessage(icol5string);
                                        }
                        }
                }
        }
//not connected
        
return 1;
}
public 
PlayerToPoint(Float:radiplayeridFloat:xFloat:yFloat:z)
{
    if(
IsPlayerConnected(playerid))
        {
                new 
Float:oldposxFloat:oldposyFloat:oldposz;
                new 
Float:tempposxFloat:tempposyFloat:tempposz;
                
GetPlayerPos(playeridoldposxoldposyoldposz);
                
tempposx = (oldposx -x);
                
tempposy = (oldposy -y);
                
tempposz = (oldposz -z);
                
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
                
if (((tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                {
                        return 
1;
                }
        }
        return 
0;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[256];
        new 
sendername[MAX_PLAYER_NAME];
        new 
giveplayer[MAX_PLAYER_NAME];
        new 
cmd[256];
        new 
tmp[256];
        new 
idx;
        
cmd strtok(cmdtextidx);
        if(
strcmp(cmd"/arbitro"true) == 0)
        {
            if(
IsPlayerConnected(playerid))
            {
                if(!
IsPlayerAdmin(playerid))
                {
                
SendClientMessage(playeridCOLOR_WHITE"You are not logged into RCON");
                return 
1;
                }
                        
tmp strtok(cmdtextidx);
                        if(!
strlen(tmp))
                        {
                                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /arbitro [playerid/PartOfName]");
                                return 
1;
                        }
                        new 
para1;
                        
para1 ReturnUser(tmp);
                        
tmp strtok(cmdtextidx);
            if(
IsPlayerConnected(para1))
                            {
                                if(
para1 != INVALID_PLAYER_ID)
                                {
                                                
GetPlayerName(para1giveplayersizeof(giveplayer));
                                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                                
arbitro[para1] = 1;
                                                
printf("%s escolhe %s como бrbitro."sendernamegiveplayer);
                                                
format(stringsizeof(string), " %s escolhe vocк como бrbitro"sendername);
                                                
SendClientMessage(para1COLOR_WHITEstring);
                                                
format(stringsizeof(string), "   Voce Escolheu %s Cmo Juiz Da Partida [GTB]."giveplayer);
                                                
SendClientMessage(playeridCOLOR_WHITEstring);
                                                
format(stringsizeof(string), " %s й o бrbitro para o prуximo jogo! Ir ao estбdio[GTB]!"giveplayer);
                                                
SendClientMessageToAll(COLOR_GROVEstring);
                                                
skin[para1] = GetPlayerSkin(para1);
                                                
SetPlayerSkin(para172);
                                        }
                                }
                }
                return 
1;
        }
        if(
strcmp(cmd"/rcmds"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
        if(
arbitro[playerid] == 1)
        {
        
format(stringsizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin"squadra1squadra2);
        
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"Referee Commands"string"Select""Exit");
        }
        }return 
1;
        }
        return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
        new 
sendername[MAX_PLAYER_NAME];
        new 
giveplayer[MAX_PLAYER_NAME];
        
GetPlayerName(playeridsendernamesizeof(sendername));
        new 
string[128];
        if(
response)
        {
        if(
dialogid == 1)
        {
                if(
listitem == 0)
                {
                
format(stringsizeof(string), " Referee commands - %s"squadra1);
                
ShowPlayerDialog(playerid2DIALOG_STYLE_LISTstring"Change team name\nAdd player""Select""Exit");
                }
                if(
listitem == 1)
                {
                
format(stringsizeof(string), " Referee commands - %s"squadra2);
                
ShowPlayerDialog(playerid3DIALOG_STYLE_LISTstring"Change team name\nAdd player""Select""Exit");
                }
                if(
listitem == 2)
                {
                if(
annunciata == 1)
                {
                
SendClientMessage(playeridCOLOR_WHITE"You announced the start of the match! Now type 'Start match'");
                return 
1;
                }
                else
                {
                
format(stringsizeof(string), " Football match between %s and %s will start in 20 minutes! Referee: %s"squadra1squadra2sendername);
                
SendClientMessageToAll(COLOR_GROVEstring);
                
annunciata 1;
                for(new 
0MAX_PLAYERSi++)
                {
                if(
allenamento[i] == 1)
                {
                
SetPlayerPos(i, -182.5193,-135.1851,5.0900);
                
SendClientMessage(iCOLOR_WHITE"Training is finish because a match will start soon!");
                
allenamento[i] = 0;
                }
                }
                }
                }
                if(
listitem == 3)
                {
                
ShowPlayerDialog(playerid10DIALOG_STYLE_LISTstring"Add Stuart\nFire Stuart""Select""Exit");
                }
                if(
listitem == 4)
                {
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* Referee %s starts the match."sendername);
                
ProxDetector(50.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                if(
listitem == 5)
                {
                
DestroyObject(palla);
                
palla CreateObject(1598, -180.464828, -7.4257052.4143980.00000.00000.0000);
                }
                if(
listitem == 6)
                {
                new 
FloatXFloatYFloatZ;
                
GetPlayerPos(playeridXYZ);
                
DestroyObject(palla);
                
palla CreateObject(1598XY2.4143980.00000.00000.0000);
                }
                if(
listitem == 7)
                {
                
ShowPlayerDialog(playerid4DIALOG_STYLE_INPUT"Fire player""Please insert id of the player""Select""Exit");
                }
                if(
listitem == 8)
                {
                
format(stringsizeof(string), "%s\n%s"squadra1squadra2);
        
ShowPlayerDialog(playerid5DIALOG_STYLE_LIST"Referee commands - Goal"string"Select""Exit");
                }
                if(
listitem == 9)
                {
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* Referee %s stops the match."sendername);
                
ProxDetector(50.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                if(
listitem == 10)
                {
                
format(stringsizeof(string), "Match is finish: %s %d - %d %s"squadra1goal1goal2squadra2);
                
SendClientMessageToAll(COLOR_GROVEstring);
                
goal1 0;
                
goal2 0;
                
annunciata 0;
                
squadra1 "Team1";
                
squadra2 "Team2";
                for(new 
0MAX_PLAYERSi++)
                {
                if(
giocatore[i] >= || arbitro[i] == || stuart[i] == 1)
                {
                
SetPlayerSkin(iskin[i]);
                
giocatore[i] = 0;
                
arbitro[i] = 0;
                
stuart[i] = 0;
                }
                }
                }
                if(
listitem == 11)
                {
                new 
coin random(2)+1;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                new 
coinname[20];
                if(
coin == 1) { coinname "head"; }
                else { 
coinname "tail"; }
                
format(stringsizeof(string), "*** Referee %s flips a coin and lands on a %s"sendername,coinname);
                
ProxDetector(20.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                }
        if(
dialogid == 2)
        {
                if(
listitem == 0)
                {
                
ShowPlayerDialog(playerid6DIALOG_STYLE_INPUT"Change name""Insert the name of the Team1""Select""Exit");
                }
                if(
listitem == 1)
                {
                
ShowPlayerDialog(playerid7DIALOG_STYLE_INPUT"Add player""Insert id of the player to add""Select""Exit");
                }
        }
        if(
dialogid == 3)
        {
                if(
listitem == 0)
                {
                
ShowPlayerDialog(playerid8DIALOG_STYLE_INPUT"Change name""Insert the name of the Team2""Select""Exit");
                }
                if(
listitem == 1)
                {
                
ShowPlayerDialog(playerid9DIALOG_STYLE_INPUT"Add Player""Insert id of the player to add""Select""Exit");
                }
        }
        if(
dialogid == 4)
        {
        if(
strlen(inputtext))
                    {
                                new 
giveplayerid;
                                
giveplayerid ReturnUser(inputtext);
                                if(
IsPlayerConnected(giveplayerid))
                                {
                                    if(
giveplayerid != INVALID_PLAYER_ID && giocatore[giveplayerid] >= 1)
                                    {
                                    
giocatore[giveplayerid] = 0;
                                    
SetPlayerSkin(giveplayeridskin[giveplayerid]);
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
format(stringsizeof(string), "You fired %s"giveplayer);
                                    
SendClientMessage(playeridCOLOR_WHITEstring);
                                    
format(stringsizeof(string), "You were been fired by referee %s"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                                    }
                                }
                        }
        }
        if(
dialogid == 5)
        {
                if(
listitem == 0)
                {
                
goal1 ++;
                
format(stringsizeof(string), "[SPEAKER]: Current goals: %s %d - %d %s"squadra1goal1goal2squadra2);
                
ProxDetector(100.0playeridstringCOLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
                }
                if(
listitem == 1)
                {
                
goal2 ++;
                
format(stringsizeof(string), "[SPEAKER]: Current goals: %s %d - %d %s"squadra1goal1goal2squadra2);
                
ProxDetector(100.0playeridstringCOLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE,COLOR_GROVE);
                }
        }
        if(
dialogid == 6)
        {
        if(
strlen(inputtext))
                    {
                                
format(stringsizeof(string), "%s"inputtext);
                                
strmid(squadra1string0strlen(string), 255);
                                
format(stringsizeof(string), "Team1 name: %s"squadra1);
                                
SendClientMessage(playeridCOLOR_WHITEstring);
                        }
        }
        if(
dialogid == 7)
        {
        if(
strlen(inputtext))
                    {
                                new 
giveplayerid;
                                
giveplayerid ReturnUser(inputtext);
                                if(
IsPlayerConnected(giveplayerid))
                                {
                                    if(
giveplayerid != INVALID_PLAYER_ID)
                                    {
                                    
giocatore[giveplayerid] = 1;
                                    
skin[giveplayerid] = GetPlayerSkin(giveplayerid);
                                    
SetPlayerSkin(giveplayerid96);
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
format(stringsizeof(string), "%s now plays for %s"giveplayersquadra1);
                                    
SendClientMessage(playeridCOLOR_WHITEstring);
                                    
format(stringsizeof(string), " Referee %s authorized you to play"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                                    }
                                }
                        }
        }
        if(
dialogid == 8)
        {
        if(
strlen(inputtext))
                    {
                                
format(stringsizeof(string), "%s"inputtext);
                                
strmid(squadra2string0strlen(string), 255);
                                
format(stringsizeof(string), "Team2 name: %s"squadra2);
                                
SendClientMessage(playeridCOLOR_WHITEstring);
                        }
        }
        if(
dialogid == 9)
        {
        if(
strlen(inputtext))
                    {
                                new 
giveplayerid;
                                
giveplayerid ReturnUser(inputtext);
                                if(
IsPlayerConnected(giveplayerid))
                                {
                                    if(
giveplayerid != INVALID_PLAYER_ID)
                                    {
                                    
giocatore[giveplayerid] = 2;
                                    
skin[giveplayerid] = GetPlayerSkin(giveplayerid);
                                    
SetPlayerSkin(giveplayerid23);
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
format(stringsizeof(string), "%s now plays for %s"giveplayersquadra2);
                                    
SendClientMessage(playeridCOLOR_WHITEstring);
                                    
format(stringsizeof(string), " Referee %s has authorized you to play"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                                    }
                                }
                        }
        }
        if(
dialogid == 10)
        {
        if(
listitem == 0)
        {
        
ShowPlayerDialog(playerid11DIALOG_STYLE_INPUT"Add Stuart""Insert id of the player to add""Select""Exit");
        }
        if(
listitem == 1)
        {
        
ShowPlayerDialog(playerid12DIALOG_STYLE_INPUT"Fire Stuart""Insert id of the player to fire""Select""Exit");
        }
        }
        if(
dialogid == 11)
        {
        if(
strlen(inputtext))
                    {
                                new 
giveplayerid;
                                
giveplayerid ReturnUser(inputtext);
                                if(
IsPlayerConnected(giveplayerid))
                                {
                                    if(
giveplayerid != INVALID_PLAYER_ID)
                                    {
                                    
stuart[giveplayerid] = 1;
                                    
skin[giveplayerid] = GetPlayerSkin(giveplayerid);
                                    
SetPlayerSkin(giveplayerid16);
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
format(stringsizeof(string), "%s now is a stuart"giveplayer);
                                    
SendClientMessage(playeridCOLOR_WHITEstring);
                                    
format(stringsizeof(string), " Referee %s authorized you as a stuart"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                                    }
                                }
                        }
        }
        if(
dialogid == 12)
        {
        if(
strlen(inputtext))
                    {
                                new 
giveplayerid;
                                
giveplayerid ReturnUser(inputtext);
                                if(
IsPlayerConnected(giveplayerid))
                                {
                                    if(
giveplayerid != INVALID_PLAYER_ID && stuart[giveplayerid] >= 1)
                                    {
                                    
stuart[giveplayerid] = 0;
                                    
SetPlayerSkin(giveplayeridskin[giveplayerid]);
                                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                    
format(stringsizeof(string), "You fired %s from"giveplayer);
                                    
SendClientMessage(playeridCOLOR_WHITEstring);
                                    
format(stringsizeof(string), "Referee %s has de-authorized you as stuart"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                                    }
                                }
                        }
        }
        if(
dialogid == 13)
        {
        if(
listitem == 0)
        {
        
format(stringsizeof(string), "grandstand $6\ndiscovery platform $5\ncurve fans %s $3\ncurve fans %s $3"squadra1squadra2);
    
ShowPlayerDialog(playerid14DIALOG_STYLE_LIST"Tickets - Buy ticket"string"Select""Exit");
        }
        if(
listitem == 1)
        {
        new 
money GetPlayerMoney(playerid);
        if(
money 30)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You don't have $30!");
        return 
1;
        }
        else
        {
        if(
fumogeno[playerid] == 1)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You can't buy another smoker for this match!");
        return 
1;
        }
        else
        {
        
GivePlayerMoney(playerid, -30);
        
SendClientMessage(playeridCOLOR_WHITE"You bought a smoker for $30!");
        
GivePlayerWeapon(playerid171);
        
fumogeno[playerid] = 1;
        }
        }
        }
        }
        if(
dialogid == 14)
        {
        if(
listitem == 0)
        {
        new 
money GetPlayerMoney(playerid);
        if(
money 6)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You don't have $6!");
        return 
1;
        }
        else
        {
        
GivePlayerMoney(playerid, -6);
        
biglietto[playerid] = 1;
        
SendClientMessage(playeridCOLOR_WHITE"You bought a ticket, it can't be used 2 times");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[HINT]: You will pass into a metal detector and all your guns will be taken");
        }
        }
        if(
listitem == 1)
        {
        new 
money GetPlayerMoney(playerid);
        if(
money 5)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You don't have $5!");
        return 
1;
        }
        else
        {
        
GivePlayerMoney(playerid, -5);
        
biglietto[playerid] = 2;
        
SendClientMessage(playeridCOLOR_WHITE"You bought a ticket, it can't be used 2 times");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[HINT]: You will pass into a metal detector and all your guns will be taken");
        }
        }
        if(
listitem == 2)
        {
        new 
money GetPlayerMoney(playerid);
        if(
money 3)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You don't have $3!");
        return 
1;
        }
        else
        {
        
GivePlayerMoney(playerid, -3);
        
biglietto[playerid] = 3;
        
SendClientMessage(playeridCOLOR_WHITE"You bought a ticket, it can't be used 2 times");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[HINT]: You will pass into a metal detector and all your guns will be taken");
        }
        }
        if(
listitem == 3)
        {
        new 
money GetPlayerMoney(playerid);
        if(
money 5)
        {
        
SendClientMessage(playeridCOLOR_WHITE"You don't have $3!");
        return 
1;
        }
        else
        {
        
GivePlayerMoney(playerid, -3);
        
biglietto[playerid] = 4;
        
SendClientMessage(playeridCOLOR_WHITE"You bought a ticket, it can't be used 2 times");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[HINT]: You will pass into a metal detector and all your guns will be taken");
        }
        }
        }
        if(
dialogid == 15)
        {
        if(
listitem == 0)
                        {
                        
SetPlayerPos(playerid, -211.9384,3.9319,7.9039);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
spettatore[playerid] = 1;
                        }
        if(
listitem == 1)
                        {
                
SetPlayerPos(playerid, -147.5607,-19.1419,8.0165);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
spettatore[playerid] = 1;               }
    if(
listitem == 2)
                        {
                
SetPlayerPos(playerid, -200.3670,-55.6259,9.6309);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
spettatore[playerid] = 1;               }
    if(
listitem == 3)
                        {
                
SetPlayerPos(playerid, -160.0574,40.9410,8.3338);
                        
SendClientMessage(playeridCOLOR_WHITE"Go down from ladders to exit from the stadium");
                        
GameTextForPlayer(playerid"~g~Welcome"50001);
                        
spettatore[playerid] = 1;
                }
        }
        }
//end response
        
return 1;

FS completa, que puder grato ja agradeci vcs aki no forum sу por ter me respondido, novamente muito obrigado!
Reply
#7

upando pra ver se alguem ajuda pf ''/
Reply
#8

Vocк quer os comandos assim?

/rcmds announce

/rcmds stuart
Reply
#9

ййr nгo entendi muito o que quiz dizer ''/ mais tipo se possivel digitar /rcmds ai aparecer os comandos em texto abaixo na tela ai para executar o cmd ter que escrever por exemplo /startmatch
Reply
#10

Vocк quer passar todos os comando em Dialog para Text ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)