| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 7,844
» Latest member: rr2483533
» Forum threads: 2,377
» Forum posts: 12,276
Full Statistics
|
| Online Users |
There are currently 170 online users. » 1 Member(s) | 166 Guest(s) Google, Bing, Applebot, MoD
|
| Latest Threads |
The size of the output am...
Forum: Questions and Suggestions
Last Post: wartacho
Yesterday, 11:56 AM
» Replies: 1
» Views: 210
|
Why your server's economy...
Forum: General Discussions
Last Post: wartacho
Yesterday, 11:39 AM
» Replies: 0
» Views: 33
|
Battlezone 2050 - Circa 2...
Forum: Gamemodes
Last Post: SwisherSweet
Yesterday, 03:43 AM
» Replies: 1
» Views: 41
|
World War 3 - TDM - Circa...
Forum: Gamemodes
Last Post: SwisherSweet
Yesterday, 03:24 AM
» Replies: 0
» Views: 28
|
Vortex Gaming server
Forum: Ex-Yu
Last Post: pmemorex2016
2026-01-10, 02:32 PM
» Replies: 0
» Views: 28
|
ZombieX Survival 0.3.7
Forum: Advertisements
Last Post: fazpharma148
2026-01-10, 11:47 AM
» Replies: 0
» Views: 28
|
The status of the INPC SD...
Forum: Support
Last Post: DLCode
2026-01-07, 07:33 AM
» Replies: 0
» Views: 61
|
SAMP server trailer
Forum: Videos and Screenshots
Last Post: pmemorex2016
2026-01-06, 02:34 PM
» Replies: 0
» Views: 61
|
PROJECT: LOS ANGELES — TH...
Forum: Advertisements
Last Post: DevonH
2026-01-03, 04:04 AM
» Replies: 9
» Views: 1,059
|
I recommend Xiaomi Rednot...
Forum: Tech
Last Post: NoxxeR
2026-01-03, 01:31 AM
» Replies: 0
» Views: 96
|
|
|
| Plugin failed to load |
|
Posted by: Hype - 2019-05-31, 02:07 PM - Forum: Support
- Replies (2)
|
 |
I'm trying to load compiled GDK map in plugin but it fails to load:
1. I followed all steps correctly, gamemode loads
2. I compiled plugin in x64 instead of x86 since I don't see option to compile it in x86.
3. I have all MS bullshit .dlls for server to run this plugin
My IDE is Microsoft Visual Studio.
There are no more options to choose.
https://imgur.com/a/JGQJQvH
|
|
|
|
| sampctl again |
|
Posted by: 6cadilab9 - 2019-05-30, 09:51 PM - Forum: Support
- Replies (3)
|
 |
Sorry for asking for help again, feeling like a noob, but this is my first time using this package manager,
i've managed to compile the script, i guess everything from plugins to includes is as it is supposed to be, but now when I try to start the server using
sampctl server run
I get
ERROR: failed to interpret directory as Pawn package: failed to unmarshal samp.json: json: cannot unmarshal string into Go struct field Runtime.output of type bool
Same if I try to ensure, this is samp.json
Code: {
"rcon_password": "hidden",
"port": 7777,
"hostname": "Balkan Underground",
"maxplayers": 32,
"entry": "balkan-underground.pwn",
"output": "balkan-underground.amx"
}
|
|
|
|
| SA-MP protocol |
|
Posted by: steve2 - 2019-05-30, 09:40 PM - Forum: Support
- Replies (2)
|
 |
How do I can get an online and ping of a SA-MP servers? As I know, a SA-MP client sends UDP requests to the?server. There are?protocol description? Thx. Also I use Node.js
|
|
|
|
| [GU?A] Administrador de Templates simples PHP |
|
Posted by: DarkThinking - 2019-05-30, 05:16 PM - Forum: Programaci?n
- Replies (8)
|
 |
En esta gu?a te har? un simple administrador de templates.
Aclaro:
-> este script reemplaza un tag {dato} por una variable o el resultado de una funci?n,
-> es simple y no necesita tanto conocimiento de php para adaptarlo.
Primero crearemos una funcion para obtener el archivo:
PHP Code: <?php class Template { ? ?private $tags = []; // tags ? ?private $template; // archivo
? ?public function getFile($file) // obtener archivo ? ?{ ? ? ? ?if(file_exists($file)) // si existe el archivo ? ? ? ?{ ? ? ? ? ? ?$file = file_get_contents($file); // obtiene los datos ? ? ? ? ? ?return $file; // y retorna el archivo (los datos) ? ? ? ?} ? ? ? ?else ? ? ? ?{ ? ? ? ? ? ?return false; // retorna 0 o falso en caso de error o no existir el archivo ? ? ? ?} ? ?}
Luego creamos una funcion para "renderizar" el codigo
PHP Code: ? ?public function render() // renderizar o reemplazar tags ? ?{ ? ? ? ?$this->replaceTags(); // reemplazar tags?
? ? ? ?echo $this->template; // imprimir los datos de php reemplazando los tags ? ?}
Ahora la funcion __construct y el set para poder poner lo reemplazable en el HTML
PHP Code: ? ?public function __construct($templateFile) // buscar archivo ? ?{ ? ? ? ?$this->template = $this->getFile($templateFile); ? ? ? ?if(!$this->template) { ? ? ? ? ? ?return "Error! no puedo cargar el template -> $templateFile"; ? ? ? ?} ? ?} ? ?public function set($tag, $value) // crear tags ? ?{ ? ? ? ?$this->tags[$tag] = $value; ? ?}
Ahora la funcion que REEMPLAZA los codigos tag
PHP Code: ? ?private function replaceTags() // reemplazar tags ? ?{ ? ? ? ?foreach ($this->tags as $tag => $value) { ? ? ? ? ? ?$this->template = str_replace('{'.$tag.'}', $value, $this->template); ? ? ? ?}
? ? ? ?return true; ? ?}
}
bueno esto funciona as?:
PHP Code: <?php require_once 'Template.php'; $tpl = new Template('archivo.html'); // creamos el template el cual se carga automaticamente
$tpl->set('codigoparahtml', $variableofuncion); // creamos el tag
$tpl->render(); // "renderizamos" ?>
en el HTML ponemos:
Code: <h3>{codigoparahtml}</h3>
y se reemplazar? por
$variableofuncion
Codigo completo:
PHP Code: <?php class Template { ? ?private $tags = []; // tags ? ?private $template; // archivo
? ?public function getFile($file) // obtener archivo ? ?{ ? ? ? ?if(file_exists($file)) ? ? ? ?{ ? ? ? ? ? ?$file = file_get_contents($file); ? ? ? ? ? ?return $file; ? ? ? ?} ? ? ? ?else ? ? ? ?{ ? ? ? ? ? ?return false; ? ? ? ?} ? ?}
? ?public function render() // renderizar o reemplazar tags ? ?{ ? ? ? ?$this->replaceTags();
? ? ? ?echo $this->template; ? ?}
? ?public function __construct($templateFile) // buscar archivo ? ?{ ? ? ? ?$this->template = $this->getFile($templateFile); ? ? ? ?if(!$this->template) { ? ? ? ? ? ?return "Error! no puedo cargar el template -> $templateFile"; ? ? ? ?} ? ?} ? ?public function set($tag, $value) // crear tags ? ?{ ? ? ? ?$this->tags[$tag] = $value; ? ?} ? ?private function replaceTags() // reemplazar tags ? ?{ ? ? ? ?foreach ($this->tags as $tag => $value) { ? ? ? ? ? ?$this->template = str_replace('{'.$tag.'}', $value, $this->template); ? ? ? ?}
? ? ? ?return true; ? ?}
}
|
|
|
|
| simplificar checkpoints |
|
Posted by: zzztgtzzz - 2019-05-30, 12:00 AM - Forum: Programaci?n
- Replies (2)
|
 |
Buenas! quer?a saber como se puede hacer para reducir los checkpoints, en vez de tener todas estas lineas, hacerlo mas reducido.
Code: ? ?if(GetPVarInt(playerid,"TEST_CP") == 0)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?SetPVarInt(playerid, "TEST_CP", 1);
? ? ? ? ? ? ? ? SetPlayerCheckpoint(playerid, -4048.2869,-3002.8801,1351.9772, 5);
? ? ? ? ? ? ? ?return 1;
? ? ? ? ? ?}
? ? ? ? ? ?if(GetPVarInt(playerid,"TEST_CP") == 1)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?SetPVarInt(playerid, "TEST_CP", 2);
? ? ? ? ? ? ? ?PuntoTest[playerid] ;
? ? ? ? ? ? ? ? SetPlayerCheckpoint(playerid, -4035.4558,-3038.5496,1351.9779, 5);
? ? ? ? ? ? ? ?return 1;
? ? ? ? ? ?}
? ? ? ? ? ?if(GetPVarInt(playerid,"TEST_CP") == 2)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?SetPVarInt(playerid, "TEST_CP", 3);
? ? ? ? ? ? ? ? SetPlayerCheckpoint(playerid, -4039.2056,-3066.4712,1351.9767, 5);
? ? ? ? ? ? ? ?return 1;
? ? ? ? ? ?}
? ? ? ? ? ?if(GetPVarInt(playerid,"TEST_CP") == 3)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?SetPVarInt(playerid, "TEST_CP", 4);
? ? ? ? ? ? ? ? SetPlayerCheckpoint(playerid, -4017.9539,-3052.5557,1351.9771, 5);
? ? ? ? ? ? ? ?return 1;
? ? ? ? ? ?}
? ? ? ? ? ?if(GetPVarInt(playerid,"TEST_CP") == 4)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?SetPVarInt(playerid, "TEST_CP", 0);
? ? ? ? ? ? ? ? SetPlayerCheckpoint(playerid, ?-4048.2869,-3002.8801,1351.9772, 5);
? ? ? ? ? ? ? ?return 1;
? ? ? ? ? ?}
|
|
|
|
| y_inline - y_hooks |
|
Posted by: Juance - 2019-05-28, 10:38 PM - Forum: Spanish/Espa?ol
- Replies (2)
|
 |
Buenas a todos, mirando por el foro me encontr? que muchos acostumbran a usar librer?as de YSI como son las: y_hooks y tambi?n y_inline
Alguien podr?a darme una breve introducci?n acerca de esos dos librer?as?y en qu? caso se pueden aplicar? muchas gracias
|
|
|
|
| Loops |
|
Posted by: Cubie - 2019-05-28, 12:49 PM - Forum: Pawn Scripting
- Replies (8)
|
 |
Is there actually a way to check if a loop is finished?
I'm going to try to explain.
e.g loop:
PHP Code: foreach (new i : Player)
{
? ??if(example[playerid] == 4)
? ? {
? ? ? //Someting
? ? }
? ? return 1;
}
e.g what I wonder:
PHP Code: [Loop Finishes]
{
? //Code
}
If anybody knows a fancy other trick that is fine too off course.
Thanks in advance.
|
|
|
|
| Death spam bug |
|
Posted by: Uberanwar - 2019-05-28, 03:39 AM - Forum: Pawn Scripting
- Replies (4)
|
 |
Hi guys, I am currently experiencing a death spam bug. I am unsure what exactly made it happen. It is rare to other players, but it happens often to those who are lagging. I previously never had this issue.
Quote:[27/05/2019 06:22:03] [connection] xxxxxxxx:21883 requests connection cookie.
[27/05/2019 06:22:05] [join] Deba has joined the server (7:xxxxxxxx)
[27/05/2019 06:22:19] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: -1036.349975, Z: 24.195400, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:20] [death] Deba died 255
[27/05/2019 06:22:20] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:20] [death] Deba died 255
[27/05/2019 06:22:21] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:21] [death] Deba died 255
[27/05/2019 06:22:21] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:21] [death] Deba died 255
[27/05/2019 06:22:22] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:22] [death] Deba died 255
[27/05/2019 06:22:22] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:22] [death] Deba died 255
[27/05/2019 06:22:23] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:23:19] OnPlayerDisconnect - Deba (7) | X: -294.178710, Y: 1005.997924, Z: 19.585987, Location: Fort Carson | Int: 0, World: 0 [Reason: 1]
[27/05/2019 06:23:19] [part] Deba has left the server (7:1)
This is my OnPlayerDeath. What seems to be the problem??
Code: public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid == INVALID_PLAYER_ID) {
? ?return false; }
? ?
PlayerData[playerid][pSpawned] = 0;
new log[300], Float:pX, Float:pY, Float:pZ;
? ?new vid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, pX, pY, pZ);
if (killerid != INVALID_PLAYER_ID)
{
? ?if (1 <= reason <= 46) {
? ? ? ?format(log, sizeof(log), "[%s] %s (%d) has killed %s (%s) [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(killerid), killerid, ReturnName(playerid), playerid, ReturnWeaponName(reason), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
else {
? format(log, sizeof(log), "[%s] %s has killed %s (reason %d) [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(killerid), ReturnName(playerid), reason, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 51 && killerid != INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has been killed by explosion by %s. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), ReturnName(killerid), reason, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
else
{
if (reason == 51)
{
if(killerid == INVALID_PLAYER_ID && IsPlayerInAnyVehicle(playerid) && vid != INVALID_VEHICLE_ID)
{
format(log, sizeof(log), "[%s] %s has been killed in a car explosion [vehicle id: %d]. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), vid, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
else if(killerid == INVALID_PLAYER_ID && !IsPlayerInAnyVehicle(playerid) && vid == INVALID_VEHICLE_ID)
{
? ?format(log, sizeof(log), "[%s] %s has been killed in an explosion. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
if (reason == 53 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has drowned in the water. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 54 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has fell (Splat). [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 255 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has suicided. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
printf(log);
return true;
}
|
|
|
|
|