Jump to content

Medics Chat


Oxsotus

Recommended Posts

Hi!

I have one problem.

I want to create a chat for medics, polices, etc etc...

Here the function: first line

function mentos_chat(jatekos,parancs,uzenet) 

(in english uzenet = message)

So, I wrote the chat's command, and the message : "/mc Hello everybody"

And it's only write the word "hello".

I know, the first variable (uzenet) = Hello, and because the space the word "everybody" is the second variable, which does not exist.

So, my question is:

how to set the variable "uzenet" to text?

Here's the full code:

function mentos_chat(jatekos,parancs,uzenet) 
  
   jatekos_adats_keres = dbQuery( adatbazis, "SELECT * FROM `players` WHERE `Username`=?", getPlayerName(jatekos) ) 
   jatekos_adats = dbPoll( jatekos_adats_keres, -1 ) 
  
   akik_ = dbQuery( adatbazis, "SELECT * FROM `players` WHERE `leaderes_munka`=?", 2) 
   akik, row = dbPoll( akik_, -1 ) 
   outputChatBox(row,jatekos) 
  
     for i = 1, row, 1 do 
         
     if( isPlayerOnline(akik[i].Username) then 
         
       if(jatekos_adats[1].leaderes_rang == 1) then outputChatBox("Rádió: Próbaidős "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end 
       if(jatekos_adats[1].leaderes_rang == 2) then outputChatBox("Rádió: Ápoló "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end 
       if(jatekos_adats[1].leaderes_rang == 3) then outputChatBox("Rádió: Mentős "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end 
       if(jatekos_adats[1].leaderes_rang == 4) then outputChatBox("Rádió: Orvos "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end 
       if(jatekos_adats[1].leaderes_rang == 5) then outputChatBox("Rádió: Főnök "..jatekos_adats[1].Character..": "..uzenet,getPlayerFromName(akik[i].Username)) end 
       outputChatBox(akik[i].Username,jatekos)        
             
     end 
  
     end 
  
end 
  
addCommandHandler("mc",mentos_chat) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...