11.08.2012, 09:45
(
Last edited by Sinner; 11/08/2012 at 10:55 AM.
)
PAWN is a great language, easy to understand (considering you're somewhat into programming) and easy to implement. But what would it be like if SA-MP used a different kind of language? Aren't there better, higher-level or faster languages that could do the job?
Sometimes I wonder that if SA-MP required a more difficult language to learn (maybe, C#/+/++ or Java?) then PAWN there would be less horrible scripts because people who weren't "involved" in programming woulden't be bothered learning it in the first place.
That's not what this topic is about though. I'd really like to see what code would look like if SA-MP used ... For JAVA, I assume it could be something like this (and you're free to state your opinion on the language of your choice)!
SA-MP in JAVA?
:
Any more ideas?
Sometimes I wonder that if SA-MP required a more difficult language to learn (maybe, C#/+/++ or Java?) then PAWN there would be less horrible scripts because people who weren't "involved" in programming woulden't be bothered learning it in the first place.
That's not what this topic is about though. I'd really like to see what code would look like if SA-MP used ... For JAVA, I assume it could be something like this (and you're free to state your opinion on the language of your choice)!
SA-MP in JAVA?

PHP Code:
public int OnPlayerConnect(Player player) {
Color c = new Color(255, 255, 255);
player.sendMessage(c, "Hello there!");
return 1;
}
public int OnPlayerText(Player player, String text) {
int pID = player.getID();
int pName = player.getName();
text = pName + " [" + pID + "]: "+ text;
Color c = new Color("red");
server.sendMessage(c, text);
return 0;
}
public int OnPlayerCommandText(Player player, String cmdtext) {
if(cmdtext.equals("mycommand")) {
// Player typed "/mycommand"
return 1;
}
return 0;
}
// Or maybe create a samp object somewhere?
SObject s = new SObject(1532);
s.setCoords(0.0, 0.0, 0.0);
s.setRotation(180.0);
s.setWorld(5);
s.setVisible(true);