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