All pastes #1078322 Raw Edit

Leopard

public cpp v1 · immutable
#1078322 ·published 2008-07-21 12:08 UTC
rendered paste body
#include <a_samp>#define COLOR_YELLOW 0xFFFF00AA#define COLOR_WHITE 0xFFFFFFAAenum SavePlayerPosEnum{    Float:LastX,    Float:LastY,    Float:LastZ}new SavePlayerPos[MAX_PLAYERS][SavePlayerPosEnum];GetPlayerCurrentSpeedInKPH(playerid){	if(IsPlayerInAnyVehicle(playerid))	{		new Float:x,Float:y,Float:z;		new Float:distance,value;		GetPlayerPos(playerid, x, y, z);		distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[playerid][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[playerid][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[playerid][LastZ])),2));		SavePlayerPos[playerid][LastX] = x;    	SavePlayerPos[playerid][LastY] = y; 		SavePlayerPos[playerid][LastZ] = z;		value = floatround(distance * 11000);		value = floatround(value/1400);		return value;	}	return 1;}new IsFlipped[MAX_PLAYERS];new AutoFlip[MAX_PLAYERS];new timer1;forward KeyCheck();public OnFilterScriptInit(){	timer1 = SetTimer("KeyCheck", 1000, 1);	return 1;}public OnFilterScriptExit(){	KillTimer(timer1);	return 1;}public OnPlayerCommandText(playerid, cmdtext[]){	if(strcmp(cmdtext, "/aflip", true) == 0)	{		if(AutoFlip[playerid] == 0)		{			AutoFlip[playerid] = 1;			SendClientMessage(playerid, COLOR_WHITE, "[AUTOFLIP]: Autoflip turned on");		}		else if(AutoFlip[playerid] == 1)		{			AutoFlip[playerid] = 0;			SendClientMessage(playerid, COLOR_YELLOW, "[AUTOFLIP]: Autoflip turned onff");		}	}	return 0;}public KeyCheck(){	for(new i = 0; i < GetMaxPlayers(); i++)	{		new keys, updown, leftright;		GetPlayerKeys(i, keys, updown, leftright);		new speed = GetPlayerCurrentSpeedInKPH(i);		if(speed <= 5 && speed >= 0)		{			if(keys & KEY_SPRINT)			{				SendClientMessage(i, COLOR_WHITE, "You are flipped! Trying to flip back...");				IsFlipped[i] = 1;				if(AutoFlip[i] == 1)				{					new Float:angle;					new vehid = GetPlayerVehicleID(i);					GetVehicleZAngle(vehid, angle);					SetVehicleZAngle(vehid, angle);					SendClientMessage(i, COLOR_WHITE, "Flipped!");				}			}		}	}}