31.10.2017, 03:28
(
Last edited by Marricio; 31/10/2017 at 05:46 AM.
Reason: Added examples
)
I stumbled upon this discussion in Southclaw's Scavenge Survive's repository and I believe this could take PAWN scripting to the next level.
It would allow us to write nicer and readable code and achieve things that are very hard or impossible now. I believe the .amx file size will notably increase, but it's worth it for me.
What do you guys think?
Examples
Some random examples so you get the grasp of the idea.
Input
Output:
Input:
Output:
Input:
Output
It would allow us to write nicer and readable code and achieve things that are very hard or impossible now. I believe the .amx file size will notably increase, but it's worth it for me.
What do you guys think?
Examples
Some random examples so you get the grasp of the idea.
Input
Code:
hook event() { } hook event() { }
Code:
public event() { event_01(); event_02(); } forward event_01(); public event_01() { } forward event_02(); public event_02() { }
Code:
new Float:pos[3]; GetPlayerPos(target, pos); SetPlayerPos(playerid, pos);
Code:
new Float:pos[3]; GetPlayerPos(target, pos[0], pos[1], pos[2]); SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
Code:
new CharacterData[MAX_PLAYERS][inline enum { name[MAX_PLAYER_NAME], age(default:18)}];
Code:
enum E_CharacterData { CharacterData_name[MAX_PLAYER_NAME], CharacterData_age } new CharacterData[MAX_PLAYERS][E_CharacterData]; // gamemode init, i'm 100% sure this is not the correct way to do this. just some pseudo code for(new i; i!=sizeof(CharacterData); i++) CharacterData[i][CharacterData_Age] = 18;