View difference between Paste ID: Xb1KLHYC and 2vhUeA4V
SHOW: | | - or go back to the newest paste.
1
/* 			Sistema de Cinto de Segurança Criado Por Lucas Emmanuel.		  */
2
3
/*						Ou Lucas-Fc Forum SAMP.			*/
4
5
/*	  Autorizado a implantação desse sistema em seu Gamemode, Caso Queira  	  */
6
7
8
/*                       Minha Primeira FS :P 								  */
9
10
#include < a_samp.inc >
11
#include < zcmd.inc >
12
13
new Cinto[MAX_PLAYERS];
14
15
public OnFilterScriptInit()
16
{
17
	print("\n----------------------------------------");
18
	print(" Cinto de Segurança Carregado Com Sucesso ");
19
	print("----------------------------------------\n");
20
	return 1;
21
}
22
23
public OnPlayerSpawn(playerid)
24
{
25
	Cinto[playerid] = 0;
26
	return 1;
27
}
28
29
public OnPlayerDeath(playerid, killerid, reason)
30
{
31
	Cinto[playerid] = 0;
32
	return 1;
33
}
34
35
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
36
{
37
	if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
38
	{
39
		if( Cinto[playerid] == 0 )
40
		{
41
			new Float: VidaP;
42
			GetPlayerHealth(playerid, VidaP);
43
			SetPlayerHealth(playerid, VidaP - 65);
44
		}
45
46
		if( Cinto[playerid] == 1 )
47
		{
48
			new Float: VidaP;
49
			GetPlayerHealth(playerid, VidaP);
50
			SetPlayerHealth(playerid, VidaP - 10);
51
		}
52
	}
53
	return 1;
54
}
55-
public OnPlayerCommandText(playerid, cmdtext[])
55+
56
CMD:cinto(playerid)
57-
	if (strcmp("/Cinto", cmdtext, true, 10) == 0)
57+
58
	if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Você não está em um carro !");
59-
		if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Você não está em um carro !");
59+
60
		Cinto[playerid] = 1;
61-
			Cinto[playerid] = 1;
61+
		SendClientMessage(playerid, -1, "Você colocou seu Cinto de Segurança ! ");
62-
			SendClientMessage(playerid, -1, "Você colocou seu Cinto de Segurança ! ");
62+
63
	return 1;
64-
		return 1;
64+
65
66-
	return 0;
66+
67
{
68
	Cinto[playerid] = 0;
69
	return 1;
70
}