1. Will S.P and SourceMod work without conflicting each other? My admins don't want to switch to S.P yet because they're still used to SM. Will having both S.P and SM cause crashes or other issues?
2. SM provided cookies and mysql for storage; does S.P have such storage?
3. Considering SM's SourcePawn API that I'm very familiar with, does Source.Python have the same kind of API or additional?
For example, how would would I turn this into a .py plugin?
Syntax: Select all
int iProPlayer[ MXPLYR ];
public void OnPluginStart()
{
RegConsoleCmd("sm_pro", CommandSetWepAlpha, "Weapon Alpha");
RegConsoleCmd("sm_angles", CommandInfo, "Weapon Angles");
RegAdminCmd("sm_adpro", CommandSetAdminWepAlpha, ADMFLAG_SLAY, "Admin Weapon Alpha");
HookEvent("player_spawn", Eventery);
HookEvent("post_inventory_application", Eventery);
for (int i = 1; i <= MaxClients; i++)
{
if ( !IsValidClient(i) ) continue;
OnClientPutInServer(i);
}
}
public void OnClientPutInServer( int client )
{
iProPlayer[client] = -1;
}
public Action Eventery(Event event, const char[] name, bool dontBroadcast)
{
int i = GetClientOfUserId( event.GetInt("userid") );
if ( IsValidClient(i) )
{
if ( iProPlayer[i] != -1 ) SetWeaponInvis( i, iProPlayer[i] );
}
return Plugin_Continue;
}
stock void SetWeaponInvis(int client, int &alpha)
{
for (int i = 0; i < 5; i++)
{
int entity = GetPlayerWeaponSlot(client, i);
if ( IsValidEdict(entity) && IsValidEntity(entity) )
{
if (alpha < 0) alpha = 0;
else if (alpha > 255) alpha = 255;
SetEntityRenderMode(entity, RENDER_TRANSCOLOR);
SetEntityRenderColor(entity, 150, 150, 150, alpha);
}
}
return;
}
stock bool IsValidClient(int client, bool replaycheck = true)
{
if ( client <= 0 || client > MaxClients) return false;
if ( !IsClientInGame(client) ) return false;
if ( GetEntProp(client, Prop_Send, "m_bIsCoaching") ) return false;
if ( replaycheck ) if ( IsClientSourceTV(client) || IsClientReplay(client) ) return false;
return true;
}