Ok, I changed it is from what you had and made it tilt, here's the whole thing, not sure if its what you were looking for...
PHP Code:
/* Plugin Template generated by Pawn Studio */
#include <sdktools>
#include <sourcemod>
public Plugin:myinfo =
{
name = "New Plugin",
author = "Unknown",
description = "<- Description ->",
version = "1.0",
url = "<- URL ->"
}
public OnPluginStart()
{
RegConsoleCmd("sm_tilt", TiltToggle);
}
new bool:bIsTiltEnabled = false;
public Action:TiltToggle(client, args)
{
if(bIsTiltEnabled == false)
{
bIsTiltEnabled = true;
PrintToChat(client, "Tilt On");
}else
{
bIsTiltEnabled = false;
PrintToChat(client, "Tilt Off");
}
return Plugin_Handled;
}
public OnGameFrame()
{
for(new i=1;i<MaxClients;i++)
{
if(bIsTiltEnabled == true)
{
if(IsValidEntity(i))
{
new Float:angles[3];
GetClientEyeAngles(i, angles);
//angles[0] = 0.0;
//angles[1] = 0.0;
angles[2] -= 0.05;
TeleportEntity(i, NULL_VECTOR, angles, NULL_VECTOR);
if(angles[2] <= -5.0)
{
bIsTiltEnabled = false;
}
}
}
}
}
The player's angles pitch and yaw get stuck for some reason while its rolling. Also, OnGameFrame might be better as a timer.