AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help With Sciript, redirct server (https://forums.alliedmods.net/showthread.php?t=183251)

NeedYourHelp 04-19-2012 15:38

Help With Sciript, redirct server
 
i had this cod.
it dosent work..
fix it... thnks.. :)
PHP Code:

#include <amxmodx>
#include <sockets>
public plugin_init() {
     
register_clcmd("say /club","Function")
}
public Function(
index) {
     new 
errorerr[40]
     new 
socket socket_open("212.212.212.212"21212SOCKET_UDPerror)
     switch(
error)
     {
          case 
0err ""
          
case 1..3err " [Down]"
      
}
       
client_print indexprint_chat"212.212.212.212:21212%s"err )
       
socket_close(socket)



Bilal Pro 04-19-2012 16:10

Re: Help With Sciript, redirct server
 
Wait, do you want to redirect to that server ip adress?

NeedYourHelp 04-20-2012 15:22

Re: Help With Sciript, redirct server
 
Quote:

Originally Posted by Bilal Pro (Post 1692521)
Wait, do you want to redirect to that server ip adress?

no!
i just want to know:
if the server is work its print chat: "212.212.212.212:21212" (IP:PORT)
else its print chat: "212.212.212.212:21212 [Down]"

but my code dose not work.
all the time i see "212.212.212.212:21212".
can you fix it ?

Edit:
now i try this:

PHP Code:

#include <amxmodx>
#include <sockets>

public plugin_init() {
    
register_clcmd("say /club","Function");
}

public Function(
index) {
    new 
error;
    new 
socket socket_open("212.212.212.212"21212SOCKET_UDPerror);
    
    if ((
socket 0) && (error == 0))
        
client_print indexprint_chat"212.212.212.212:21212");
    
    else
        
client_print indexprint_chat"212.212.212.212:21212 [Down]" );
    
    
socket_close(socket);


it dosent work too :(
(the server dosent work and i see the print "212.212.212.212:21212")
Help..

lidor146 04-21-2012 03:59

Re: Help With Sciript, redirct server
 
Try to take it from xRedirect plugin..

NeedYourHelp 04-21-2012 11:17

Re: Help With Sciript, redirct server
 
Quote:

Originally Posted by lidor146 (Post 1693446)
Try to take it from xRedirect plugin..

I need help to fix my plugin..
ty..

Somebody Help ?

Bilal Pro 04-21-2012 11:23

Re: Help With Sciript, redirct server
 
Try to look inside, xRedirect plugin its in there

NeedYourHelp 04-21-2012 11:35

Re: Help With Sciript, redirct server
 
Quote:

Originally Posted by Bilal Pro (Post 1693673)
Try to look inside, xRedirect plugin its in there

I look inside...
I don`t succeed to fix my plugin..

lidor146 04-22-2012 06:53

Re: Help With Sciript, redirct server
 
That's a very hard question...
Try to make it like that:
socket_open
socket_send
let some time go by
while (socket_change()) socket_recv()
socket_close

I hope i help you a little (:

NeedYourHelp 04-22-2012 14:32

Re: Help With Sciript, redirct server
 
Quote:

Originally Posted by lidor146 (Post 1694290)
That's a very hard question...
Try to make it like that:
socket_open
socket_send
let some time go by
while (socket_change()) socket_recv()
socket_close

I hope i help you a little (:

Please help me.
I must get some help with my script.
I try to fix him about a month!!

---
Someone help ?? Please :(


All times are GMT -4. The time now is 07:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.