How would this stock be updated with the new style declarations?
PHP Code:
stock TF2_SwitchtoSlot(client, slot)
{
if (slot >= 0 && slot <= 5 && IsClientInGame(client) && IsPlayerAlive(client))
{
new String:wepclassname[64];
new wep = GetPlayerWeaponSlot(client, slot);
if (wep > MaxClients && IsValidEdict(wep) && GetEdictClassname(wep, wepclassname, sizeof(wepclassname)))
{
FakeClientCommandEx(client, "use %s", wepclassname);
SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", wep);
}
}
}
I read the SourcePan Transitional Syntax wiki, but it isn't written at a level that I can fully understand. Here's where the wiki became too confusing for me:
Quote:
Grammar
The new and old declaration grammar is below.
return-type ::= return-old | return-new
return-new ::= type-expr new-dims? // Note, dims not yet supported.
return-old ::= old-dims? label?
argdecl ::= arg-old | arg-new
arg-new ::= "const"? type-expr '&'? symbol old-dims? ('=' arg-init)?
arg-old ::= "const"? tags? '&'? symbol old-dims? ('=' arg-init)?
|