SA-MP Forums Archive
Call a Webservice - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Other (https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Call a Webservice (/showthread.php?tid=393327)



Call a Webservice - goviscrap - 17.11.2012

If i pasted this is wrong section please move it to the right

Anyway I wonder how to make a "Call a Webservice" in http?
I want it to connect with my SMS service ive having on my server.
So does anyone know how to make one?


Re: Call a Webservice - Mauzen - 17.11.2012

Depends on your system.
Youll need PHP anyways, then add the message or whatever it is to a mysql table, or use a rcon query with an own rcon command to send it to the server.
You could also take a look at the socket plugin, thats way more powerful, but more difficult to implement.


Re: Call a Webservice - goviscrap - 17.11.2012

I manage it thanks for answer!


Re: Call a Webservice - saiberfun - 18.11.2012

mind sharing your answer?

Oh and yay 3000th post




Re: Call a Webservice - goviscrap - 18.11.2012

Код:
<?php
 
/*
------------------------------------------------------------------------------
SMS_RECEIPT.PHP
------------------------------------------------------------------------------

------------------------------------------------------------------------------
*/
 
// Stдng av PHP:s felrapportering
error_reporting(0);
 
// Plocka ut avsдndarnumret
$nr = $_REQUEST['nr'];
 
// Plocka ut statuskoden
$code = urldecode($_REQUEST['code']);
 
// Gцr olika saker beroende pе statuskod
if ($code == 1) {
 
    // SMS:et har kommit fram
 
} elseif (($code == 2) || ($code == 5)) {
 
    // Fel uppstod
 
} else {
 
    // Operatцren hanterar SMS:et
 
}
?>
This was what ive came up with and it worked so when my sms service reaches the site they recieve a txt message back to their phone with this code