-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.pwn
More file actions
39 lines (32 loc) · 710 Bytes
/
Copy pathexample.pwn
File metadata and controls
39 lines (32 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <a_samp>
#include <env_samp>
main() {}
public OnGameModeInit()
{
printf("[env_samp] Variables loaded: %d", EnvCount());
// String (default type)
new host[64];
if (Env("MYSQL_HOST", host))
{
printf("[env_samp] MYSQL_HOST=%s", host);
}
// Integer
new port;
if (Env("MYSQL_PORT", port, ENV_INT))
{
printf("[env_samp] MYSQL_PORT=%d", port);
}
// Float
new Float:rate;
if (Env("TICK_RATE", rate, ENV_FLOAT))
{
printf("[env_samp] TICK_RATE=%f", rate);
}
// Boolean
new bool:debug;
if (Env("APP_DEBUG", debug, ENV_BOOL))
{
printf("[env_samp] APP_DEBUG=%d", _:debug);
}
return 1;
}