View difference between Paste ID: 1WFc0Y3K and ffee661c
SHOW: | | - or go back to the newest paste.
1
#include <a_samp>
2
3
#define COLOR_WHITE 0xFFFFFFAA
4
5
// ==== CREDITS ====
6
// [ERP]Snow
7
// ==== ====
8
9
// ==== NOTES ====
10
// ==== ====
11
12
// ==== (c) [ERP]Snow - Ryan [ 2008 ] ====
13
14
forward Slide(playerid);
15
forward IsAChopper(vehicleid);
16
17
new Sliding[MAX_PLAYERS];
18
19
public OnFilterScriptInit()
20
{
21
	print("\n--------------------------------------");
22
	print("[ERP]Snow's Chopper Sliding [FS] Loaded...");
23
	print("--------------------------------------\n");
24
	return 1;
25
}
26
27
public OnPlayerConnect(playerid)
28
{
29
	SendClientMessage(playerid, COLOR_WHITE, "This server is using [ERP]Snow's Chopper Sliding [FS].");
30
	Sliding[playerid] = 0;
31
	return 1;
32
}
33
34
public OnPlayerCommandText(playerid, cmdtext[])
35
{
36
   new cmd[256];
37
   new idx;
38
   new vehicleid;
39
   cmd = strtok(cmdtext, idx);
40
   
41
   if(strcmp(cmd, "/Slide", true) == 0)
42
   {
43
   if(IsPlayerInAnyVehicle(playerid) && IsAChopper(vehicleid) && Sliding[playerid] == 0)
44
   {
45
   Sliding[playerid] = 1;
46
   RemovePlayerFromVehicle(playerid);
47
   TogglePlayerControllable(playerid, 0);
48
   SetTimerEx("Slide", 1000, 0, "i", playerid);
49
   SendClientMessage(playerid, COLOR_WHITE, "You are sliding down the rope.");
50
   }
51
   return 1;
52
}
53
   if(strcmp(cmd, "/Stop", true) == 0)
54
   {
55
   if(Sliding[playerid] == 1)
56
   {
57
   Sliding[playerid] = 0;
58
   TogglePlayerControllable(playerid, 1);
59
   SendClientMessage(playerid, COLOR_WHITE, "You have stopped sliding.");
60
   }
61
   return 1;
62
           }
63
   return 0;
64
}
65
66
public Slide(playerid)
67
{
68
    if(Sliding[playerid] == 1)
69
    {
70
    new Float:X;
71
    new Float:Y;
72
    new Float:Z;
73
    GetPlayerPos(playerid, X, Y, Z);
74
    SetPlayerPos(playerid, X, Y, Z - 5.00);
75
    SetTimerEx("Slide", 1000, 0, "i", playerid);
76
    }
77
	return 1;
78
}
79
80
public IsAChopper(vehicleid)
81
{
82
	if(vehicleid >= 0 && vehicleid <= 1) // < Define your Chopper ID's Here
83
	{
84
	return 1;
85
	}
86
	return 0;
87
}
88
89
strtok(const string[], &index)
90
{
91
	new length = strlen(string);
92
	while ((index < length) && (string[index] <= ' '))
93
	{
94
		index++;
95
	}
96
97
	new offset = index;
98
	new result[20];
99
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
100
	{
101
		result[index - offset] = string[index];
102
		index++;
103
	}
104
	result[index - offset] = EOS;
105
	return result;
106
}
107
108
public OnFilterScriptExit()
109
{
110
    print("\n--------------------------------------");
111
	print("[ERP]Snow's Chopper Sliding [FS] UnLoaded...");
112
	print("--------------------------------------\n");
113
	return 1;
114
}