View difference between Paste ID: vLwET8qf and NNjgt2n5
SHOW: | | - or go back to the newest paste.
1
/*
2
							Checkpoint Creator v1.0
3
       							by AleeFerreira
4
       							
5
       							* Como utilizar:
6
7
- Vá no local que você deseja adicionar o checkpoint
8
- digite /criarcheckpoint e siga os dialogs
9
- você também pode adicionar um 3DText em cima dele após criar o check *-*
10
11
OBS: O script foi feito para as pessoas que usam cpstream,
12
caso você não use em seu gamemode, talvez esse creator não irá ajudá-lo muito!
13
Na próxima versão estarei adicionando uma opção para quem usa cpstream ou SetPlayerCheckpoint!
14
*/
15
16
#include <a_samp>
17
#include <zcmd>
18
#include <cpstream>
19
20
new Float:PosX;
21
new	Float:PosY;
22
new	Float:PosZ;
23
new textoinput[230];
24
new	File: Arquivo;
25
new	MSG[230];
26
27
public OnFilterScriptInit()
28
{
29
	print("\n***************************************");
30
	print(" Checkpoint Creator by AleeFerreira");
31
	print("             Carregando.. ");
32
	print("***************************************\n");
33
	return 1;
34
}
35
36
public OnFilterScriptExit()
37
{
38
	print("\n***************************************");
39
	print(" Checkpoint Creator by AleeFerreira");
40
	print("             Descarregando.. ");
41
	print("***************************************\n");
42
	return 1;
43
}
44
45
46
public OnPlayerConnect(playerid)
47
{
48
	SendClientMessage(playerid,0x004CB1AA,"Digite /criarcheckpoint para criar um checkpoint!");
49-
	SendClientMessage(playerid,0x004CB1AA,"Checkpoint Creator v1.0 by AleeFerreira - /creditoscreator");
49+
50
}
51
52
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
53
{
54
	if(dialogid == 9853)
55
	{
56
    	if(response)
57
		{
58
			GetPlayerPos(playerid, PosX, PosY, PosZ);
59
			CPS_AddCheckpoint(PosX,PosY,PosZ, 2.0, 40);
60
			SendClientMessage(playerid,0x004CB1AA,"Checkpoint criado com sucesso!");
61
            Arquivo = fopen("/Checkpoints.txt",io_append);
62
			format(MSG,230,"CPS_AddCheckpoint(%f,%f,%f, 1.0, 40);\r\n",PosX,PosY,PosZ);
63
   			fwrite(Arquivo, MSG);
64
			fclose(Arquivo);
65
			ShowPlayerDialog(playerid,9854,DIALOG_STYLE_MSGBOX,"Checkpoint Creator by AleeFerreira","Você deseja adicionar um 3Dtext no checkpoint?","Sim","Nao");
66
		}
67
    	else
68
		{
69
		}
70
	}
71
	if(dialogid == 9854)
72
	{
73
    	if(response)
74
		{
75
			ShowPlayerDialog(playerid,9974,DIALOG_STYLE_INPUT,"Checkpoint Creator by AleeFerreira","Digite o texto a ser mostrado:","Continuar","Sair");
76
		}
77
    	else
78
		{
79
   	 	}
80
	}
81
	
82
	if(dialogid == 9974)
83
	{
84
	    if(response)
85
	    {
86
            strmid( textoinput, ( inputtext ), 0, strlen( inputtext ), 255 );
87
			ShowPlayerDialog(playerid,9645,DIALOG_STYLE_LIST,"Checkpoint Creator by AleeFerreira","{004CB1}COR AZUL\n{DB4CC0}COR ROSA\n{00020F}COR PRETA\n{FFFFFF}COR BRANCA\n{00AC00}COR VERDE\n{F6F62D}COR AMARELO","Selecionar","Sair");
88
		}
89
	    else
90
	    {
91
	    }
92
	}
93
	if(dialogid == 9645)
94
	{
95
    	if(response)
96
		{
97
        	if(listitem == 0)
98
			{
99
                GetPlayerPos(playerid, PosX, PosY, PosZ);
100
                Create3DTextLabel(textoinput, 0x004CB1AA, PosX, PosY, PosZ, 10, 0, -1);
101
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
102
				Arquivo = fopen("/Checkpoints.txt",io_append);
103
				format(MSG,230,"Create3DTextLabel(\"%s\", 0x004CB1AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
104
				fwrite(Arquivo, MSG);
105
				fclose(Arquivo);
106
        	}
107
        	if(listitem == 1)
108
			{
109
   				GetPlayerPos(playerid, PosX, PosY, PosZ);
110
                Create3DTextLabel(textoinput, 0xDB4CC0AA, PosX, PosY, PosZ, 10, 0, -1);
111
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
112
				Arquivo = fopen("/Checkpoints.txt",io_append);
113
				format(MSG,230,"Create3DTextLabel(\"%s\", 0xDB4CC0AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
114
				fwrite(Arquivo, MSG);
115
				fclose(Arquivo);
116
        	}
117
        	if(listitem == 2)
118
			{
119
                GetPlayerPos(playerid, PosX, PosY, PosZ);
120
                Create3DTextLabel(textoinput, 0x00020FAA, PosX, PosY, PosZ, 10, 0, -1);
121
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
122
				Arquivo = fopen("/Checkpoints.txt",io_append);
123
				format(MSG,230,"Create3DTextLabel(\"%s\", 0x00020FAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
124
				fwrite(Arquivo, MSG);
125
				fclose(Arquivo);
126
       	 	}
127
        	if(listitem == 3)
128
			{
129
                GetPlayerPos(playerid, PosX, PosY, PosZ);
130
                Create3DTextLabel(textoinput, 0xFFFFFFAA, PosX, PosY, PosZ, 10, 0, -1);
131
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
132
                Arquivo = fopen("/Checkpoints.txt",io_append);
133
				format(MSG,230,"Create3DTextLabel(\"%s\", 0xFFFFFFAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
134
				fwrite(Arquivo, MSG);
135
				fclose(Arquivo);
136
        	}
137
        	if(listitem == 4)
138
			{
139
                GetPlayerPos(playerid, PosX, PosY, PosZ);
140
                Create3DTextLabel(textoinput, 0x00AC00AA, PosX, PosY, PosZ, 10, 0, -1);
141
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
142
				Arquivo = fopen("/Checkpoints.txt",io_append);
143
				format(MSG,230,"Create3DTextLabel(\"%s\", 0x00AC00AA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
144
				fwrite(Arquivo, MSG);
145
				fclose(Arquivo);
146
        	}
147
       		if(listitem == 5)
148
			{
149
                GetPlayerPos(playerid, PosX, PosY, PosZ);
150
                Create3DTextLabel(textoinput, 0xF6F62DAA, PosX, PosY, PosZ, 10, 0, -1);
151
                SendClientMessage(playerid,0x004CB1AA,"3DText adicionado com sucesso!");
152
				Arquivo = fopen("/Checkpoints.txt",io_append);
153
				format(MSG,230,"Create3DTextLabel(\"%s\", 0xF6F62DAA, %f, %f, %f, 10, 0, -1);\r\n",textoinput,PosX,PosY,PosZ);
154
				fwrite(Arquivo, MSG);
155
				fclose(Arquivo);
156
        	}
157
        	if(listitem == 6)
158
        	{
159
        	}
160
    	}
161
    	else
162
		{
163
    	}
164
	}
165
	return 1;
166
}
167
168
//****************************** COMMANDS :) ******************************
169
170
CMD:criarcheckpoint(playerid)
171
{
172
	ShowPlayerDialog(playerid,9853,DIALOG_STYLE_MSGBOX,"Checkpoint Creator by AleeFerreira","Você deseja criar um checkpoint aqui?","Sim","Nao");
173
	return true;
174
}
175
176
CMD:creditoscreator(playerid)
177
{
178
    ShowPlayerDialog(playerid,9322,DIALOG_STYLE_MSGBOX,"Checkpoint Creator Créditos","AleeFerreira - Criador\nZeeX - Zcmd\n[MPA]matraka_IDG - cpstream\nEquipe SA-MP For All","OK","Sair");
179
    return true;
180
}