30.08.2011, 01:27
pawn Код:
#include <a_samp>
// ==== CREDITS ====
// [ERP]Snow
// ==== ====
// ==== NOTES ====
// ==== ====
// ==== © [ERP]Snow - Ryan [ 2008 ] ====
forward Slide(playerid);
new
Sliding[MAX_PLAYERS],
Timer[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("[ERP]Snow's Chopper Sliding [FS] Loaded...");
print("--------------------------------------\n");
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, -1, "This server is using [ERP]Snow's Chopper Sliding [FS].");
Sliding[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Slide", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid) && Sliding[playerid] == 0)
{
Sliding[playerid] = 1;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 0);
Timer[playerid] = SetTimerEx("Slide", 1000, true , "i", playerid);
SendClientMessage(playerid, -1, "You are sliding down the rope.");
}
return 1;
}
if(strcmp(cmdtext, "/Stop", true) == 0)
{
if(Sliding[playerid])
{
KillTimer( Timer[ playerid ] );
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, -1, "You have stopped sliding.");
}
return 1;
}
return 0;
}
public Slide(playerid)
{
if(Sliding[playerid])
{
static
Float:X,
Float:Y,
Float:Z
;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z - 5.00);
SetTimerEx("Slide", 1000, 0, "i", playerid);
}
return 1;
}