Jump to content

mikeee324

Members
  • Posts

    14
  • Joined

  • Last visited

mikeee324's Achievements

Square

Square (6/54)

0

Reputation

  1. Both the web server and MTA server are on the same machine so that's why i'm using localhost. Tried both tcp and udp on the main port and the web port of the mta server, it's not having any of it.
  2. I used the example from the php site, but now it just seems to be saying my servers online when it isn't I mean i can even use any port and it'll say it's online. Anyone know how i can do this accurately? $fp = fsockopen("udp://127.0.0.1", 22003, $errno, $errstr); if (!$fp) { echo "Offline"; } else { echo "Online"; fclose($fp); echo "</td>"; } I read somewhere too that the system might not know that theres nothing there until data is written/read to/from the port, i tried using fread but it didn't bring anything back at all.
  3. Sorted, needed to do it over UDP instead of TCP.
  4. I'm running a MTA server and a web server on a ubuntu vps. I've been trying to ping the mta sa server using fsockopen and all I keep getting from it is connection refused. How do I see if the server is running?
  5. Thanks solidsnake! Combined your code with a function I found on the net to capitalize the first letter of a string and it's working just as I need it now.
  6. The command I've already written gets the model the same way... If you give it "inf" or "sult" it'll return false.
  7. I'm already using that function but it only seems to work with full words. What I'm after is being able to type "/v inf" and it spawn an infernus. If i do that with getVehicleModelFromName it just returns false.
  8. Cheers for that. Anyone know how i could do the second part of my first post though? Would it just involve creating a table with the names and going through it with string.find or is there a quicker way?
  9. How would I go about doing this? For example I have my vehicle spawning command that uses vehicle names. I enter /spawnveh hotring racer It'll only try "hotring" and won't spawn anything. How would I make it take the whole string? Also is there a way i can search for just parts of vehicle names instead of the whole names?
  10. I'm pretty new to lua and I'm also not good at loops in lua, and I'm not sure how i loop through every vehicle in the server. Could anybody give me an example of a loop or a better way to delete all the vehicle in the server?
  11. mikeee324

    Mysql

    yeah was going to that after i got it working which i have now (new to lua so the dots confuse me ) cheers
  12. mikeee324

    Mysql

    I've been trying to make a register system that uses the mysql module from the wiki but this code i have always gives me an error. addEventHandler ( "onPlayerRegister", getRootElement(), function(username, password) local query = mysql_query(handler, "SELECT * FROM players WHERE username = "..username) if (mysql_num_rows(query) == 0) then mysql_query(handler, "INSERT INTO players (username, password) VALUES ('"..username.."',md5('"..password.."'))") else -- Account exists end mysql_free_result(query) end) the error is: bad argument #1 to 'mysql_num_rows' (mysqlResult expected, got nil) The table i'm querying is empty but that shouldn't affect what mysql_num_rows gets should it?
  13. EDIT: Thanks dude! Turns out having a .zip and the folder failed deleted the zip and changed it in the folder and its fine now cheers
  14. I ain't sure if this has been answered and i just need to know. I recently got cannonballs usersystem working on my server, but its causing me to have everyone's text twice. yes i know the fix which is to remove the freeroam resource, but I'd like to keep it or at least somebody show me an alternative. I've been searching everywhere and I'd really appreciate anybodies help.
×
×
  • Create New...