31.05.2010, 14:38
(
Last edited by Trooper[Y]; 09/11/2010 at 06:50 PM.
)
NOTE:
This Script is outdated !
Not only that its written for 0.2X, 0.3a includes a http function, which makes pwncurl unnecessary.
Also a script got released, which needs no big file or a plugin for detecting the players country.
One word - in 0.2x this was sth good, now you can make it 500% better yourself...
Cheers together.
I just wondered, why theres no translation plugin for SAMP Servers.
As i found pwncurl, i thought "hey, do it yourself. you already did so many things with this less feedback, no one ever remembers you, no one knows you, youve never seen any script with your scripts, but maybe this aint it !"
So, let me start with the credits:
*DracoBlue (pwncurl)
*Totto8492 (GeoIP)
*[HiC]Thekiller & [HiC]Cam (Demo-Gamemode)
Setup (Server) :
1. Download the Package
2. Extract it and copy every folder to your samp server direction
3. Setup server.cfg (read the example server.cfg to see everything you need)
4. Run the Server
Setup (Script) :
1. After youve made the server ready, add
to the top of your script.
2. Add
at the top of the callback
Commands / Syntax you can use now :
playerid = player to send the message to (means, the text will be translated to his language)
string = the string to get translated
endstring = the string to store the translated text in
fromplayer = player who wrote string[] (-1 = no player = english)
return 1 by sucess, returns 0 + print error (+ writes src.txt for debugging) by any mistakes
Just add this under OnPlayerConnect, as the script needs to get the language of the user
return always 1
Example (from the gamemode) :
Tips :
1. Dont translate multiple lines in multiple translations. This takes too many ressources. Translate it once and split it !
2. Use simple english ! Words like "spawn" can sound very urgent in different languages.
Download :
http://rapidshare.com/files/39365859...late_Linux.rar (~15,5 MB)
This Script is outdated !
Not only that its written for 0.2X, 0.3a includes a http function, which makes pwncurl unnecessary.
Also a script got released, which needs no big file or a plugin for detecting the players country.
One word - in 0.2x this was sth good, now you can make it 500% better yourself...
Cheers together.
I just wondered, why theres no translation plugin for SAMP Servers.
As i found pwncurl, i thought "hey, do it yourself. you already did so many things with this less feedback, no one ever remembers you, no one knows you, youve never seen any script with your scripts, but maybe this aint it !"
So, let me start with the credits:
*DracoBlue (pwncurl)
*Totto8492 (GeoIP)
*[HiC]Thekiller & [HiC]Cam (Demo-Gamemode)
Setup (Server) :
1. Download the Package
2. Extract it and copy every folder to your samp server direction
3. Setup server.cfg (read the example server.cfg to see everything you need)
4. Run the Server
Setup (Script) :
1. After youve made the server ready, add
Quote:
#include <iTranslate> |
2. Add
Quote:
iTranslate_OnPlayerConnect(playerid); |
Quote:
public OnPlayerConnect(playerid) |
Quote:
translate(playerid,string[],endstring[],fromplayer); |
string = the string to get translated
endstring = the string to store the translated text in
fromplayer = player who wrote string[] (-1 = no player = english)
return 1 by sucess, returns 0 + print error (+ writes src.txt for debugging) by any mistakes
Quote:
iTranslate_OnPlayerConnect(playerid); |
return always 1
Example (from the gamemode) :
Code:
public Inter_SendClientMessage(playerid,color,msg[],fromplayer) { new gettranslation[2048]; if(translate(playerid,msg,gettranslation,fromplayer)) SendClientMessage(playerid,color,gettranslation); return 1; }
1. Dont translate multiple lines in multiple translations. This takes too many ressources. Translate it once and split it !
2. Use simple english ! Words like "spawn" can sound very urgent in different languages.
Download :
http://rapidshare.com/files/39365859...late_Linux.rar (~15,5 MB)