Quote:
Originally Posted by thecount
PHP Code:
#include <sourcemod>
public OnPluginStart(){ RegConsoleCmd("sm_tp", Command_Thirdperson, "Sets thirdperson."); RegConsoleCmd("sm_fp", Command_Firstperson, "Sets firstperson."); }
public Action:Command_Thirdperson (client, args){ if(IsPlayerAlive(client)){ PrintToChat(client, "[SM] Thirdperson"); ClientCommand(client, "thirdperson"); }else{ PrintToChat(client, "[SM] Not alive."); } return Plugin_Handled; }
public Action:Command_Firstperson (client, args){ if(IsPlayerAlive(client)){ PrintToChat(client, "[SM] Firstperson"); ClientCommand(client, "firstperson"); }else{ PrintToChat(client, "[SM] Not alive."); } return Plugin_Handled; }
Works?
|
by default it doesn't work, the message pops up but you're still in firstperson, I had to set sv_cheats to 1 and
then it works fine
I set sv_cheats back to 0, and the plugin still works, so I guess it needs a workaround when the plugin loads to set sv_cheats to 1 then back to 0 immediately, idk
__________________