i have ycmd, how to send a messaage to a player if he write a performed command?
↧
ycmd problem
↧
Drift Track.








↧
↧
Char arrays
Hi everyone,
so I've been making my GM for last 2 years (with some breaks ofc) and the other day I read an article about char arrays. They are basically here for us to use when we want to save a variable that's between 0 and 255 and doing this we can save some memory.
So I want to switch my VIP and Helper variable to char (to save those 140kbs :rolleyes:) but the problem is that I can't go through the whole script and change the [] brackets to {} brackets, because it would take me an hour to do it manually. Is there a fast way to do this?
Thanks in advanced.
so I've been making my GM for last 2 years (with some breaks ofc) and the other day I read an article about char arrays. They are basically here for us to use when we want to save a variable that's between 0 and 255 and doing this we can save some memory.
So I want to switch my VIP and Helper variable to char (to save those 140kbs :rolleyes:) but the problem is that I can't go through the whole script and change the [] brackets to {} brackets, because it would take me an hour to do it manually. Is there a fast way to do this?
Thanks in advanced.
↧
does not match definition
Code:
forward CheckTimer();
public CheckTimer() {
new string[256];
if(RestartTime > 0 ){
RestartTime --;
if(RestartTime/60 >1) format(string, sizeof(string)), "Restart-ul se va da peste ~y~%d minute~w~~n~Motiv: %s", RestartTime/60, RestartReason);
else if(RestartTime/60 == 1) format(string, sizeof(string)), "Restart-ul se va da peste ~y~%d minute~w~~n~Motiv: %s", RestartTime/60, RestartReason);
else if(RestartTime/60 == 0)format(string, sizeof(string)), "Restart-ul se va da peste ~y~%d minute~w~~n~Motiv: %s", RestartTime/60, RestartReason);
TextDrawSetString(RestartTD, string);
TextDrawShowForAll(RestartTD);
if(RestartTime == 5) KickAll();
if(RestartTime == 0) GameModeExit();
}
return 1;
}
D:\server\gamemodes\ExtremeGame.pwn(22319) : warning 215: expression has no effect
D:\server\gamemodes\ExtremeGame.pwn(22319) : warning 215: expression has no effect
D:\server\gamemodes\ExtremeGame.pwn(22319) : warning 215: expression has no effect
D:\server\gamemodes\ExtremeGame.pwn(22319) : error 001: expected token: ";", but found ")"
D:\server\gamemodes\ExtremeGame.pwn(22319) : error 029: invalid expression, assumed zero
D:\server\gamemodes\ExtremeGame.pwn(22319) : warning 215: expression has no effect
help please
↧
[GameMode] Ruthless Roleplay Gamemodes/Scripts
Hello everyone this is the Ruthless Roleplay gamemodes.
The gamemode may have some bugs that I didn't fixed yet.
Well, that's what I can tell about the gamemodes/Scripts:
-Admin Ranks(/setadmin)
A1-Junior Admin
A2-General Admin
A3-Senior Admin
A4-Head Admin
A5-Server Management
Helper Ranks(/sethelper)
H1-Junior Helper
H2-Senior Helper
H3-Assistant Head Helper
H4-Head Helper
H5-Helper Management
Moderator(/setmoderator).
-Quiz System (/quiz)
-Hunt System (/allhunt)
-Bandana System (/bandana)
-Check Factions System (/factions)
-Editable Factions (/editfaction)
-In Game Mapping (/creategate-/gedit)
-Minigame System (For a little refund, /joingame at preshing square)
-And More Systems to be checked in game.
Warning: The scripts was made in 2014-2015, released at 2017 with a lot of bugs and now I am releasing it without many bugs, please for any update you will made, I would like to be informed, Thank you!
Download Link:
https://www.sendspace.com/file/j24gox
Known Bugs:
- Gang Delete (/fdelete)
- Available Turfs (It dispears once the turf is at 0 hours [/turfs])
- Army's Badge
WARNING: There is a backdoor command, remove it at pawno: CTRL-F dontstealmyscriptplz
Enjoy the gamemode :)
Special Thanks to:
Leroy Jethro Gibbs
Xav Martin
Mike Clark
Version: 0.3.7-R2
No MySQL Needed
The gamemode may have some bugs that I didn't fixed yet.
Well, that's what I can tell about the gamemodes/Scripts:
-Admin Ranks(/setadmin)
A1-Junior Admin
A2-General Admin
A3-Senior Admin
A4-Head Admin
A5-Server Management
Helper Ranks(/sethelper)
H1-Junior Helper
H2-Senior Helper
H3-Assistant Head Helper
H4-Head Helper
H5-Helper Management
Moderator(/setmoderator).
-Quiz System (/quiz)
-Hunt System (/allhunt)
-Bandana System (/bandana)
-Check Factions System (/factions)
-Editable Factions (/editfaction)
-In Game Mapping (/creategate-/gedit)
-Minigame System (For a little refund, /joingame at preshing square)
-And More Systems to be checked in game.
Warning: The scripts was made in 2014-2015, released at 2017 with a lot of bugs and now I am releasing it without many bugs, please for any update you will made, I would like to be informed, Thank you!
Download Link:
https://www.sendspace.com/file/j24gox
Known Bugs:
- Gang Delete (/fdelete)
- Available Turfs (It dispears once the turf is at 0 hours [/turfs])
- Army's Badge
WARNING: There is a backdoor command, remove it at pawno: CTRL-F dontstealmyscriptplz
Enjoy the gamemode :)
Special Thanks to:
Leroy Jethro Gibbs
Xav Martin
Mike Clark
Version: 0.3.7-R2
No MySQL Needed
↧
↧
Suspect file/folder name in SAMP directory
Someone know the suspect file/folder name into SAMP directory for verification?
Examples (basic):
[folder] mod_sa
[folder] cleo
[file] mod_sa.*
[file] [*.cs]
Examples (basic):
[folder] mod_sa
[folder] cleo
[file] mod_sa.*
[file] [*.cs]
↧
Is there any UCP / Shop released template available?
Hello there,
I actually own a community and nowadays I'm in need of UCP and a Shop, just wanted to ask that if there is any released UCP / shop available and if you got the link, please share it on this thread.
Thank you.
I actually own a community and nowadays I'm in need of UCP and a Shop, just wanted to ask that if there is any released UCP / shop available and if you got the link, please share it on this thread.
Thank you.
↧
[MAP]Police Departament LS + rescue
Hello, how are you ? well with me great. I hereby introduce to you my new map of the police department of the saints + rescue (used in trucking servers) I hope your evaluations.
Images:
![]()
![]()
![]()
Album link:
https://ibb.co/album/cJv2Qa
Images:



Album link:
https://ibb.co/album/cJv2Qa
↧
[Ajuda] input line too long (after substitutions)
Recentemente eu TENTEI usar a include "Nex-Ac" baixei a include e o .lang (tradução, obrigado a ter) certinho, editei a linha que marca o nome do .lang, porém dá esse erro em TODAS as linhas do .lang, o erro aparece tanto quando com compila o gm com o #include, como tanto no INC do include.
O .lang abaixo:
Eu já vasculhei quase todos os tópicos que contém esse erro, eu já baixer o compilador Zeex.
HTML Code:
(0) : error 075: input line too long (after substitutions)
(2) : error 075: input line too long (after substitutions)
(3) : error 075: input line too long (after substitutions)
(4) : error 075: input line too long (after substitutions)
(5) : error 075: input line too long (after substitutions
(6) : error 075: input line too long (after substitutions)
(7) : error 075: input line too long (after substitutions)
(8) : error 075: input line too long (after substitutions)
(9) : error 075: input line too long (after substitutions)
(10) : error 075: input line too long (after substitutions)
(11) : error 075: input line too long (after substitutions)
(12) : error 075: input line too long (after substitutions)
(13) : error 075: input line too long (after substitutions)
(14) : error 075: input line too long (after substitutions)
(15) : error 075: input line too long (after substitutions)
(16) : error 075: input line too long (after substitutions)
(17) : error 075: input line too long (after substitutions)
(18) : error 075: input line too long (after substitutions)
(19) : error 075: input line too long (after substitutions)
(20) : error 075: input line too long (after substitutions)
(21) : error 075: input line too long (after substitutions)
(22) : error 075: input line too long (after substitutions)
g(23) : error 075: input line too long (after substitutions)
(24) : error 075: input line too long (after substitutions)
(25) : error 075: input line too long (after substitutions)
(26) : error 075: input line too long (after substitutions)
Compilation aborted.
Pawn compiler 3.2.3664 Copyright (c) 1997-2017, ITB CompuPhase
26 Errors.
PHP Code:
#if defined _nex_ac_lang_included
#endinput
#endif
#define _nex_ac_lang_included
new
SUSPICION_1[] = "[Servidor] Suspeita no ID %d. Código de motivo: %03d%s",
SUSPICION_2[] = "[Servidor] Suspeita no IP %s. Código de motivo: %03d%s",
VERSION_WARNING[] = "[Servidor] Esta versão do anticheat não é compatível com a versão do servidor",
CFG_OPENING_ERROR[] = "[Nex-AC] Erro ao criar/abrir %s!",
#if defined DEBUG
DEBUG_CODE_1[] = "[Servidor debug] ID %d excedeu %d tentativas de flooding. Public ID: %d",
DEBUG_CODE_2[] = "[Servidor debug] Versão inválida no ID %d. Versão: %s",
DEBUG_CODE_3[] = "[Servidor debug] ID %d excedeu %d conexões por um IP",
DEBUG_CODE_4[] = "[Servidor debug] Tentativa de login na RCON pelo IP %s usando senha %s",
DEBUG_CODE_5[] = "[Servidor debug] ID %d usando NOP %s",
#endif
KICK_MSG[] = "Você foi kickado por suspeitas de uso de cheating (#%03d)",
MAX_CONNECTS_MSG[] = "Você excedeu o número máximo de conexões pelo seu IP",
UNKNOWN_CLIENT_MSG[] = "Esta versão do cliente não é adequada para jogar no servidor",
LOADED_MSG_1[] = " Anticheat Nex-AC carregado!",
LOADED_MSG_2[] = " Anticheat versão: %s",
LOADED_MSG_3[] = " Autor: Nexius (PT-BR by NicK_)",
STATS_STRING_1[] = " Estatísticas do anticheat Nex-AC",
STATS_STRING_2[] = " Detectando e previnindo:",
STATS_STRING_3[] = " %d tentativas de cheating",
STATS_STRING_4[] = " %d tentativas de hacking",
STATS_STRING_5[] = " %d tentativas de crashing",
STATS_STRING_6[] = " %d tentativas de flooding",
STATS_STRING_7[] = " %d attaques",
STATS_STRING_8[] = " Total de detecções e punições em %d cheaters";
↧
↧
uundefined symbol "CMDMessageToVips"
error undefined symbol "CMDMessageToVips " have solution help
[code]
cmd(vsetarmour,playerid,params[]) {
if(PlayerInfo[playerid][Vip] >= 3) {
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /vsetarmour [playerid] [amount]");
if(strval(tmp2) < 0 || strval(tmp2) > 100 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "ERROR: Invaild health amount");
new player1 = strval(tmp), armour = strval(tmp2), string[128];
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
CMDMessageToVips(playerid,"vsetarmour");
format(string, sizeof(string), "You have set \"%s's\" armour to '%d", pName(player1), armour); SendClientMessage(playerid,blue,string);
if(player1 != playerid) { format(string,sizeof(string),"Vip \"%s\" has set your armour to '%d'", pName(playerid), armour); SendClientMessage(player1,blue,string); }
return SetPlayerArmour(player1, armour);
} else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
} else return ShowPlayerDialog(playerid, 199, DIALOG_STYLE_MSGBOX, "{FF0000}INFO: No Tienes level para este Comando", "\n{FF0000}ERROR: {FFFFFF}You need to be Vip level 3 to use this command\n\n{FF0000}ERROR: {FFFFFF}Tienes que ser Vip level 3 para usar este comando", "Aceptar", "");
}
/code
[code]
cmd(vsetarmour,playerid,params[]) {
if(PlayerInfo[playerid][Vip] >= 3) {
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2)) return SendClientMessage(playerid, red, "USAGE: /vsetarmour [playerid] [amount]");
if(strval(tmp2) < 0 || strval(tmp2) > 100 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid, red, "ERROR: Invaild health amount");
new player1 = strval(tmp), armour = strval(tmp2), string[128];
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
CMDMessageToVips(playerid,"vsetarmour");
format(string, sizeof(string), "You have set \"%s's\" armour to '%d", pName(player1), armour); SendClientMessage(playerid,blue,string);
if(player1 != playerid) { format(string,sizeof(string),"Vip \"%s\" has set your armour to '%d'", pName(playerid), armour); SendClientMessage(player1,blue,string); }
return SetPlayerArmour(player1, armour);
} else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
} else return ShowPlayerDialog(playerid, 199, DIALOG_STYLE_MSGBOX, "{FF0000}INFO: No Tienes level para este Comando", "\n{FF0000}ERROR: {FFFFFF}You need to be Vip level 3 to use this command\n\n{FF0000}ERROR: {FFFFFF}Tienes que ser Vip level 3 para usar este comando", "Aceptar", "");
}
/code
↧
[FilterScript] House System * C-HOUSE
Introduction
I created this Filterscript especially here for the SAMP forum.
To use the members and to encourage the use of SQLite rescue, and the Pawn.CMD plugin.
Among other reasons. Remembering that the code is released for use and editing while keeping the creator's credits.
There is not much to talk about FS.
It is like any other system of houses,
but updated optimized and using current releases.
Commands
♦ Administrator
/createhouse
/deletehouse
/edithouse
/gohouse
♦ Players
/buyhouse
/sellhouse
/lock
Imagens
Images are in Portuguese language. But the script is in English.
Album
Script
Credits
Includes creators.
Cleyson by total code creation
◘ Sorry my bad english. :*
I created this Filterscript especially here for the SAMP forum.
To use the members and to encourage the use of SQLite rescue, and the Pawn.CMD plugin.
Among other reasons. Remembering that the code is released for use and editing while keeping the creator's credits.
There is not much to talk about FS.
It is like any other system of houses,
but updated optimized and using current releases.
Commands
♦ Administrator
/createhouse
/deletehouse
/edithouse
/gohouse
♦ Players
/buyhouse
/sellhouse
/lock
Imagens
Images are in Portuguese language. But the script is in English.
Album
Script
PHP Code:
/*
FilterScript House System C-HOUSE.
Create by Cleyson Stein - StNN
Do not withdraw credits.
All rights reserved. 05/02/2018 *
*/
#include <a_samp>
#include <pawn.cmd>
#include <sscanf2>
#include <streamer>
enum
{
MAX_HOUSE = 100, // Max house
RED = 0xFF000FFF,
CINZA = 0xCECECEFF,
ORANGE = 0xF97804FF,
};
enum pInfo
{
Name[24],
HasHouse,
EnterHouse,
};
new p[MAX_PLAYERS][pInfo];
enum cInfo
{
cOwner[24],
Float:cX,
Float:cY,
Float:cZ,
cOccupied,
cLocked,
cIcon,
cPickup,
cInt,
Text3D:cText,
cPrice
};
new c[MAX_HOUSE][cInfo], TotalHouse;
// interior houses
enum inter
{
Float:iX,
Float:iY,
Float:iZ,
Float:iA,
iID
}
new interior[][inter] =
{
{2196.84, -1204.36, 1049.02, 94.0010, 6},
{2259.38, -1135.89, 1050.64, 275.3992, 10},
{2282.99, -1140.28, 1050.89, 358.4660, 11},
{2233.69, -1115.26, 1050.88, 358.4660, 5},
{2218.39, -1076.21, 1050.48, 95.2635, 1},
{2496.00, -1692.08, 1014.74, 177.8159, 3},
{2365.25, -1135.58, 1050.88, 359.0367, 8},
{2317.77, -1026.76, 1050.21, 359.0367, 9},
{2324.41, -1149.54, 1050.71, 359.0367, 12},
{1260.6603, -785.4005, 1091.9063, 270.9891, 5},
{140.28, 1365.92, 1083.85, 9.6901, 5}
};
// sqlite
new DB:Database;
public OnFilterScriptInit()
{
print("\n-------------------------------------");
print(" System C-HOUSE successfully loaded.");
print(" Created by Cleyson Stein - StNN.");
print(" All rights reserved - 02/05/2018");
print("-------------------------------------\n");
ConnectDB();
LoadHouse();
EnableStuntBonusForAll(0);
DisableInteriorEnterExits();
return 1;
}
public OnFilterScriptExit()
{
db_close(Database);
for(new i = 0; i < MAX_HOUSE; ++i)
{
DestroyDynamicPickup(c[i][cPickup]);
DestroyDynamicMapIcon(c[i][cIcon]);
DestroyDynamic3DTextLabel(c[i][cText]);
}
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, p[playerid][Name], 24);
LoadPlayer(playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(p[playerid][HasHouse] > 0) SavePlayer(playerid);
return 1;
}
// ============= COMMANDS ADMIN
CMD:ahouse(playerid)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "Command restricted to administrators.");
new String_COMANDOS[220]; //
format(String_COMANDOS, sizeof String_COMANDOS, "");
strcat(String_COMANDOS, "{009900}ADMIN C-HOUSE\n\n");
strcat(String_COMANDOS, "{CECECE}/createhouse {FFFFFF}- Create a house.\n");
strcat(String_COMANDOS, "{CECECE}/edithouse {FFFFFF}- Edit house.\n");
strcat(String_COMANDOS, "{CECECE}/deletehouse {FFFFFF}- Delete house.\n");
strcat(String_COMANDOS, "{CECECE}/gohouse {FFFFFF}- Go to house.\n");
ShowPlayerDialog(playerid, 9545, DIALOG_STYLE_MSGBOX, "Commands Admin C-HOUSE", String_COMANDOS, "Ok", "");
return 1;
}
CMD:createhouse(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "Command restricted to administrators.");
if(sscanf(params, "ii", params[0], params[1])) return SendClientMessage(playerid, CINZA, "Use /createhouse [price] [int 0a10]");
Create_House(playerid, TotalHouse+1, params[0], params[1]);
return 1;
}
CMD:gohouse(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "Command restricted to administrators.");
if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, CINZA, "Use /gohouse [id]");
Go_House(playerid, params[0]);
return 1;
}
CMD:edithouse(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "Command restricted to administrators.");
if(sscanf(params, "iii", params[0], params[1], params[2])) return SendClientMessage(playerid, CINZA, "Use /edithouse [id] [price] [int 0a10]");
Edit_House(playerid, params[0], params[1], params[2]);
return 1;
}
CMD:deletehouse(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "Command restricted to administrators.");
if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, CINZA, "Use /deletehouse [id]");
Delete_House(playerid, params[0]);
return 1;
}
// ================= COMMANDS PLAYERS
/*CMD:money(playerid)
{
GivePlayerMoney(playerid, 500000);
return 1;
}
*/
CMD:buyhouse(playerid)
{
for(new i = 0; i < MAX_HOUSE; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, c[i][cX], c[i][cY], c[i][cZ]))
{
if(p[playerid][HasHouse] > 0) return SendClientMessage(playerid, RED, "You already own a house..");
if(c[i][cOccupied] == 1) return SendClientMessage(playerid, RED, "This house already owns.");
if(GetPlayerMoney(playerid) < c[i][cPrice]) return SendClientMessage(playerid, RED, "Insufficient moneye.");
format(c[i][cOwner], 24, p[playerid][Name]);
c[i][cOccupied] = 1;
p[playerid][HasHouse] = i;
SendClientMessage(playerid, ORANGE, "House successfully acquired.");
GivePlayerMoney(playerid, -c[i][cPrice]);
DestroyDynamicPickup(c[i][cPickup]);
DestroyDynamicMapIcon(c[i][cIcon]);
DestroyDynamic3DTextLabel(c[i][cText]);
new texto[200];
c[i][cIcon] = CreateDynamicMapIcon(c[i][cX], c[i][cY], c[i][cZ], 32, -1);
c[i][cPickup] = CreateDynamicPickup(19522, 21, c[i][cX], c[i][cY], c[i][cZ]);//1272
format(texto, sizeof(texto), "{B22222}HOUSE ID: {FFFFFF}%d\n{CD5C5C}Owner: {FFFFFF}%s\n{CD5C5C}Price: {FFFFFF}$ %d{CD5C5C}\n/helphouse", i, c[i][cOwner], c[i][cPrice]);
c[i][cText] = CreateDynamic3DTextLabel(texto, 0xFFFFFFAA, c[i][cX], c[i][cY], c[i][cZ]+1, 20);
new Query[80];
format(Query, sizeof(Query), "UPDATE HOUSES SET OWNER ='%s', OCCUPIED = 1 WHERE ID =%d", c[i][cOwner], i);
db_query(Database, Query);
break;
}
}
return 1;
}
CMD:sellhouse(playerid)
{
for(new i = 0; i < MAX_HOUSE; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, c[i][cX], c[i][cY], c[i][cZ]))
{
if(p[playerid][HasHouse] == 0) return SendClientMessage(playerid, RED, "You do not own a house.");
if(c[i][cOccupied] == 0) return SendClientMessage(playerid, RED, "This house does not have an owner.");
if(p[playerid][HasHouse] == i)
{
SendClientMessage(playerid, ORANGE, "House sold successfully.");
GivePlayerMoney(playerid, c[i][cPrice]/2);
format(c[i][cOwner], 24, "None");
c[i][cOccupied] = 0;
p[playerid][HasHouse] = 0;
DestroyDynamicPickup(c[i][cPickup]);
DestroyDynamicMapIcon(c[i][cIcon]);
DestroyDynamic3DTextLabel(c[i][cText]);
new texto[200];
c[i][cIcon] = CreateDynamicMapIcon(c[i][cX], c[i][cY], c[i][cZ], 31, -1);
c[i][cPickup] = CreateDynamicPickup(1273, 21, c[i][cX], c[i][cY], c[i][cZ]);
format(texto, sizeof(texto), "{2E8B57}HOUSE ID: {FFFFFF}%d\n{3CB371}Owner: {FFFFFF}%s\n{3CB371}Price: {FFFFFF}$ %d\n{3CB371}Press 'F' to enter\n/helphouse", i, c[i][cOwner], c[i][cPrice]);
c[i][cText] = CreateDynamic3DTextLabel(texto, 0xFFFFFFAA, c[i][cX], c[i][cY], c[i][cZ]+1, 20);
new Query[80];
format(Query, sizeof(Query), "UPDATE HOUSES SET OWNER ='%s', OCCUPIED = 0 WHERE ID =%d", c[i][cOwner], i);
db_query(Database, Query);
break;
} else {
SendClientMessage(playerid, RED, "This house is not yours.");
return 1;
}
}
}
return 1;
}
CMD:lock(playerid)
{
for(new i = 0; i < MAX_HOUSE; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, c[i][cX], c[i][cY], c[i][cZ]))
{
if(p[playerid][HasHouse] == 0) return SendClientMessage(playerid, RED, "You do not own a house.");
if(c[i][cOccupied] == 0) return SendClientMessage(playerid, RED, "This house does not have an owner.");
if(p[playerid][HasHouse] == i)
{
new Query[80];
if(c[i][cLocked] == 0)
{
SendClientMessage(playerid, ORANGE, "Locked house.");
c[i][cLocked] = 1;
format(Query, sizeof(Query), "UPDATE HOUSES SET LOCKED = 1 WHERE ID =%d", i);
db_query(Database, Query);
break;
} else {
SendClientMessage(playerid, ORANGE, "Unlocked house.");
c[i][cLocked] = 0;
format(Query, sizeof(Query), "UPDATE HOUSES SET LOCKED = 0 WHERE ID =%d", i);
db_query(Database, Query);
break;
}
} else {
SendClientMessage(playerid, RED, "This house is not yours.");
return 1;
}
}
}
return 1;
}
CMD:helphouse(playerid)
{
ShowPlayerDialog(playerid, 9595, DIALOG_STYLE_MSGBOX, "Help C-House","{009900}HOUSES\n\n{CECECE}/buyhouse {FFFFFF}- Buy a house.\n{CECECE}/sellhouse {FFFFFF}- Sell your house.\n{CECECE}/lock {FFFFFF}- lock | unlock house.\n", "Ok", "");
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK) // KEY F
{
for(new x = 0; x < MAX_HOUSE; x++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, c[x][cX], c[x][cY], c[x][cZ]))
{
if(c[x][cOccupied] == 0)
{
SetPlayerPos(playerid, interior[c[x][cInt]][iX], interior[c[x][cInt]][iY], interior[c[x][cInt]][iZ]);
SetPlayerFacingAngle(playerid, interior[c[x][cInt]][iA]);
SetPlayerInterior(playerid, interior[c[x][cInt]][iID]);
p[playerid][EnterHouse] = x;
SendClientMessage(playerid, ORANGE, "House for sale! To buy use /buyhouse in the pickup from outside. Use 'N' to exit.");
break;
}
if(c[x][cOccupied] == 1)
{
if(c[x][cLocked] == 1 && p[playerid][HasHouse] != x) return SendClientMessage(playerid, RED, "Locked house.");
if(p[playerid][HasHouse] == x)
{
SetPlayerPos(playerid, interior[c[x][cInt]][iX], interior[c[x][cInt]][iY], interior[c[x][cInt]][iZ]);
SetPlayerFacingAngle(playerid, interior[c[x][cInt]][iA]);
SetPlayerInterior(playerid, interior[c[x][cInt]][iID]);
p[playerid][EnterHouse] = x;
SendClientMessage(playerid, ORANGE, "Welcome to your home. Use 'N' to exit.");
break;
} else {
SendClientMessage(playerid, RED, "This house is not yours.");
return 1;
}
}
}
}
}
if(newkeys == 131072) // KEY N
{
if(p[playerid][EnterHouse] > 0)
{
SetPlayerPos(playerid, c[p[playerid][EnterHouse]][cX], c[p[playerid][EnterHouse]][cY], c[p[playerid][EnterHouse]][cZ]);
SetPlayerInterior(playerid, 0);
p[playerid][EnterHouse] = 0;
}
}
return 1;
}
// ============== DATA
ConnectDB()
{
if((Database = db_open("C-House.db")) == DB:0)
{
SendRconCommand("exit");
print("Failed to connect to SQlite DataBase"); // DEBUG
} else {
print("Successfully Connected to DataBase SQlite."); // DEBUG
}
//criar a db esta em db.txt
new Query[280];
format(Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS HOUSES(ID INTEGER PRIMARY KEY AUTOINCREMENT,\
OWNER TEXT DEFAULT '',\
X FLOAT DEFAULT 0.0,\
Y FLOAT DEFAULT 0.0,\
Z FLOAT DEFAULT 0.0,\
INTERIOR INTEGER DEFAULT 0,\
LOCKED INTEGER DEFAULT 0,\
OCCUPIED INTEGER DEFAULT 0,\
PRICE INTEGER DEFAULT 0)");
db_query(Database, Query);
format(Query, sizeof(Query), "CREATE TABLE IF NOT EXISTS OWNERS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NOME TEXT DEFAULT '', CASAID INTEGER DEFAULT 0)");
db_query(Database, Query);
return 1;
}
LoadPlayer(playerid)
{
new DBResult:Result, Query[65];
format(Query, sizeof(Query), "SELECT * FROM OWNERS WHERE NOME = '%s'", p[playerid][Name]);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
p[playerid][HasHouse] = db_get_field_assoc_int(Result, "CASAID");
} else {
new Query2[75];
format(Query2, sizeof(Query2), "INSERT INTO OWNERS (NOME, CASAID) VALUES ('%s', 0)", p[playerid][Name]);
db_query(Database, Query2);
p[playerid][HasHouse] = 0;
}
db_free_result(Result);
return 1;
}
SavePlayer(playerid)
{
new Query[75];
format(Query, sizeof(Query), "UPDATE OWNERS SET CASAID =%d WHERE NOME ='%s'", p[playerid][HasHouse], p[playerid][Name]);
db_query(Database, Query);
return 1;
}
// ============== INIT
LoadHouse()
{
new DBResult:Result, Query[50];
for(new i = 0; i < MAX_HOUSE; i++)
{
format(Query, sizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d", i);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
db_get_field_assoc(Result, "OWNER", c[i][cOwner], 24);
c[i][cX] = db_get_field_assoc_float(Result, "X");
c[i][cY] = db_get_field_assoc_float(Result, "Y");
c[i][cZ] = db_get_field_assoc_float(Result, "Z");
c[i][cOccupied] = db_get_field_assoc_int(Result, "OCCUPIED");
c[i][cPrice] = db_get_field_assoc_int(Result, "PRICE");
c[i][cInt] = db_get_field_assoc_int(Result, "INTERIOR");
c[i][cLocked] = db_get_field_assoc_int(Result, "LOCKED");
TotalHouse ++;
CreateHouse(i);
}
db_free_result(Result);
}
printf("\nHouse loaded: %d", TotalHouse);
return 1;
}
CreateHouse(i)
{
new texto[200];
if(c[i][cOccupied] == 0)
{
c[i][cIcon] = CreateDynamicMapIcon(c[i][cX], c[i][cY], c[i][cZ], 31, -1);
c[i][cPickup] = CreateDynamicPickup(1273, 21, c[i][cX], c[i][cY], c[i][cZ]);
format(texto, sizeof(texto), "{2E8B57}HOUSE ID: {FFFFFF}%d\n{3CB371}Owner: {FFFFFF}%s\n{3CB371}Price: {FFFFFF}$ %d\n{3CB371}Press 'F' to enter\n/helphouse", i, c[i][cOwner], c[i][cPrice]);
c[i][cText] = CreateDynamic3DTextLabel(texto, 0xFFFFFFAA, c[i][cX], c[i][cY], c[i][cZ]+1, 20);
}
else if(c[i][cOccupied] == 1)
{
c[i][cIcon] = CreateDynamicMapIcon(c[i][cX], c[i][cY], c[i][cZ], 32, -1);
c[i][cPickup] = CreateDynamicPickup(19522, 21, c[i][cX], c[i][cY], c[i][cZ]);//1272
format(texto, sizeof(texto), "{B22222}HOUSE ID: {FFFFFF}%d\n{CD5C5C}Owner: {FFFFFF}%s\n{CD5C5C}Price: {FFFFFF}$ %d{CD5C5C}\n/helphouse", i, c[i][cOwner], c[i][cPrice]);
c[i][cText] = CreateDynamic3DTextLabel(texto, 0xFFFFFFAA, c[i][cX], c[i][cY], c[i][cZ]+1, 20);
}
return 1;
}
// ============== ADMIN
Create_House(playerid, id, preco, inte)
{
new DBResult:Result, Query[160];
format(Query, sizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d", id);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
SendClientMessage(playerid, RED, "Error.");
} else {
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
format(c[id][cOwner], 24, "None");
c[id][cX] = Pos[0];
c[id][cY] = Pos[1];
c[id][cZ] = Pos[2];
c[id][cOccupied] = 0;
c[id][cPrice] = preco;
c[id][cInt] = inte;
SendClientMessage(playerid, ORANGE, "House created successfully.");
CreateHouse(id);
format(Query, sizeof(Query), "INSERT INTO HOUSES(OWNER, X, Y, Z, PRICE, INTERIOR) VALUES ('%s', %f, %f, %f, %d, %d)", c[id][cOwner], c[id][cX], c[id][cY], c[id][cZ], c[id][cPrice], c[id][cInt]);
db_query(Database, Query);
TotalHouse ++;
}
db_free_result(Result);
return 1;
}
Edit_House(playerid, id, preco, interi)
{
new DBResult:Result, Query[50];
format(Query, sizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d", id);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
new string[60];
format(string, sizeof(string), "You have successfully edited the house id %d", id);
SendClientMessage(playerid, ORANGE, string);
c[id][cPrice] = preco;
c[id][cInt] = interi;
DestroyDynamicPickup(c[id][cPickup]);
DestroyDynamicMapIcon(c[id][cIcon]);
DestroyDynamic3DTextLabel(c[id][cText]);
CreateHouse(id);
} else {
SendClientMessage(playerid, RED, "Error.");
}
db_free_result(Result);
return 1;
}
Go_House(playerid, id)
{
new DBResult:Result, Query[50];
format(Query, sizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d", id);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
new string[60];
format(string, sizeof(string), "You went home id %d.", id);
SendClientMessage(playerid, ORANGE, string);
SetPlayerPos(playerid, c[id][cX], c[id][cY], c[id][cZ]);
SetPlayerInterior(playerid, 0);
} else {
SendClientMessage(playerid, RED, "Error.");
}
db_free_result(Result);
return 1;
}
Delete_House(playerid, id)
{
new DBResult:Result, Query[50];
format(Query, sizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d", id);
Result = db_query(Database, Query);
if(db_num_rows(Result))
{
format(Query, sizeof(Query), "DELETE FROM HOUSES WHERE ID = %d", id);
db_query(Database, Query);
new string[60];
format(string, sizeof(string), "You have successfully deleted the house id %d", id);
SendClientMessage(playerid, ORANGE, string);
format(c[id][cOwner], 24, "None");
c[id][cX] = -1;
c[id][cY] = -1;
c[id][cZ] = -1;
c[id][cOccupied] = -1;
c[id][cPrice] = -1;
c[id][cInt] = -1;
c[id][cLocked] = -1;
DestroyDynamicPickup(c[id][cPickup]);
DestroyDynamicMapIcon(c[id][cIcon]);
DestroyDynamic3DTextLabel(c[id][cText]);
TotalHouse --;
} else {
SendClientMessage(playerid, RED, "Error.");
}
db_free_result(Result);
return 1;
}
Credits
Includes creators.
Cleyson by total code creation
◘ Sorry my bad english. :*
↧
A Command!
I've creating a command for break the cuffs! And I've do it only for Civilian BUT If someone go Cops he can use it too!! Why?
PHP Code:
CMD:breakcuff(playerid, params[])
{
if(!Civilian(GetPlayerSkin(playerid))) return SendClientMessage(playerid, -1, "{ff0000}Error: {Ffffff}Only Civilian can use this comamnd");
{
new targetid;
if(BeginArrested[targetid] == 1)
{
KillTimer(BeginArrestedTime[targetid]);
SendClientMessage(targetid, -1, "{FF7000}YOU HAVE BEEN ESCAPED FROM ARRESTED!!! RUN RUN !!!!");
SetPlayerWantedLevel(targetid, 3);
SetPlayerColor(targetid, YELLOW);
GameTextForPlayer(targetid, "~Y~ESCAPED FROM ~G~ARRESTED ~P~ RUN BABY!!!", 7000, 5);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
BeginArrested[targetid] = 0;
}
else SendClientMessage(targetid, -1, "{FF0000}Error: {FFFFFF}You can use this command only while be cuffed or arrested.");
}
return 1;
}
PHP Code:
stock PoliceTeam(skinid)
{
switch(skinid)
{
case 280:return 1;
case 285:return 1;
case 165:return 1;
case 166:return 1;
case 286:return 1;
case 287:return 1;
default: return 0;
}
return 0;
}
stock Civilian(skinid)
{
switch(skinid)
{
case 1..300:return 1;
default: return 0;
}
return 0;
}
↧
[Ajuda] Colocar em DIALOG
Como faço pra transformar em DIALOG_STYLE_MSGBOX ?
Code:
if(strcmp("/rg", cmd, true) == 0)
{
new string222[256];
format(string222, sizeof(string222), "......:::::: - %s: [ID: %d] - ::::::.....", GetPlayerNameEx(playerid), playerid);
SendClientMessage(playerid, -1, string222);
format(string, sizeof(string), "{CCFF00}» EXP: %d/%d {00BFFF}» Grana na Mão: $%d", PlayerInfo[playerid][_EXP], MAX_PLAYER_EXP, GetPlayerGrana(playerid));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{00BFFF}» Level: %d/%d {00FF00}» Saldo Bancário: $%d", PlayerInfo[playerid][_Level], MAX_PLAYER_LEVEL, PlayerInfo[playerid][_SaldoBancario]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{CCFF00}» Estudo: %d/%d {00BFFF}» Casou Com: %s", PlayerInfo[playerid][_Faculdade], MAX_PLAYER_ESTUDO, PlayerInfo[playerid][_CasouCom]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{00BFFF}» Profissão ID: %d {00FF00}» Skin ID: %d", PlayerInfo[playerid][_Profissao], PlayerInfo[playerid][_Skin]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{CCFF00}» Matou: %d {00BFFF}» Morreu: %d", matou[playerid], morreu[playerid]);
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, string222);
return 1;
}
Code:
if(strcmp("/rg", cmd, true) == 0)
{
new string222[256];
format(string222, sizeof(string222), "......:::::: - %s: [ID: %d] - ::::::.....", GetPlayerNameEx(playerid), playerid);
SendClientMessage(playerid, -1, string222);
format(string, sizeof(string), "{CCFF00}» EXP: %d/%d {00BFFF}» Grana na Mão: $%d", PlayerInfo[playerid][_EXP], MAX_PLAYER_EXP, GetPlayerGrana(playerid));
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{00BFFF}» Level: %d/%d {00FF00}» Saldo Bancário: $%d", PlayerInfo[playerid][_Level], MAX_PLAYER_LEVEL, PlayerInfo[playerid][_SaldoBancario]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{CCFF00}» Estudo: %d/%d {00BFFF}» Casou Com: %s", PlayerInfo[playerid][_Faculdade], MAX_PLAYER_ESTUDO, PlayerInfo[playerid][_CasouCom]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{00BFFF}» Profissão ID: %d {00FF00}» Skin ID: %d", PlayerInfo[playerid][_Profissao], PlayerInfo[playerid][_Skin]);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), "{CCFF00}» Matou: %d {00BFFF}» Morreu: %d", matou[playerid], morreu[playerid]);
SendClientMessage(playerid, -1, string);
SendClientMessage(playerid, -1, string222);
return 1;
}
↧
↧
[Ajuda] Ajuda Comando
PHP Code:
new pedirajuda[MAX_PLAYERS];
CMD:pajuda(playerid,params[])
{
SendClientMessage(playerid,-1,"Você está na fila /Verfila");
pedirajuda[playerid] = 1;
return 1;
}
CMD:verfila(playerid,params[])
{
new str[144];
for(new i; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i))
{
if(pedirajuda[i] == 1)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"1° - %s \n 2° - %s \n 3° - %s \n 4° - %s \n 5° - %s ",name);
ShowPlayerDialog(playerid,Fila,DIALOG_STYLE_MSGBOX," -- Fila De Ajuda --",str,"Ok","");
}else{
ShowPlayerDialog(playerid,Fila,DIALOG_STYLE_MSGBOX," -- Fila De Ajuda --","Não Há Ninguem Na Fila de Ajuda","Ok","");
}
}
}
return 1;
}
↧
Detect wheels
Hi guys, how are you? So I was wondering how to detect if the player is near any of the 4 wheels of the vehicle, should I use GetVehicleModelInfo? If so, how?
↧
Help Dialog
Well, when the player selects an item from list 1 does not want to appear and write a file in the correct folder, can anyone help me?
Quote:
#include <a_samp> #include <DOF2> #define FILTERSCRIPT #if defined FILTERSCRIPT #define DIALOG_MENUBANCO 10 #define DIALOG_ATOA 11 #define Conta_Bancaria "Conta_Bancaria/%s.ini" #define PRESSED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) public OnFilterScriptInit() { Create3DTextLabel ( "{FFFFFF}Banco\n{0080FF}Caixa Economica Federal" , -1, 1457.1023,-1010.2794,26.8438, 10,0, 0 ) ; AddStaticPickup (1239, 1, 246.3607,118.3901,1003.2188, 9);//CRIAR CONTA BANCO CAIXA AddStaticPickup (1318, 1, 1457.1023,-1010.2794,26.8438, 0);//ENTRAR BANCO CAIXA ECONOMICA AddStaticPickup (1318, 1, 246.3823,107.3037,1003.2188, 9); //SAIR BANCO CAIXA ECONOMICA //los santos CreateObject(19324, 1712.70520, -1606.86523, 13.16780, 0.00000, 0.00000, 90.00000); CreateObject(19324, 1363.70190, -1751.15320, 13.14280, 0.00000, 0.00000, -90.00000); CreateObject(19324, 1928.57056, -1782.69446, 13.16680, 0.00000, 0.00000, 90.00000); CreateObject(19324, 2813.98096, -1864.31506, 10.71490, 0.00000, 0.00000, 90.00000); CreateObject(19324, 1867.70032, -1270.52026, 13.16690, 0.00000, 0.00000, -180.00000); CreateObject(19324, 1012.07581, -928.98840, 41.94380, 0.00000, 0.00000, 9.00000); CreateObject(19324, 344.93640, -1634.79285, 32.93120, 0.00000, 0.00000, -9.00000); CreateObject(19324, 1070.83716, -1865.75635, 13.18650, 0.00000, 0.00000, -90.00000); return 1; } public OnFilterScriptExit() { DOF2_Exit(); return 1; } public OnPlayerKeyStateChange ( playerid, newkeys, oldkeys) { if(IsPlayerInRangeOfPoint (playerid, 1.0, 1713.3195,-1606.8651,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 2814.5859,-1864.3014,11.1107) || IsPlayerInRangeOfPoint (playerid, 1.0, 1867.6738,-1269.9186,13.5678) || IsPlayerInRangeOfPoint (playerid, 1.0, 1929.1844,-1782.6046,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 1070.0872,-1865.8032,13.5469) || IsPlayerInRangeOfPoint (playerid, 1.0, 1363.0895,-1751.1373,13.5253) || IsPlayerInRangeOfPoint (playerid, 1.0, 1012.2360,-929.7780,42.3281) ||IsPlayerInRangeOfPoint (playerid, 1.0, 344.8210,-1635.4070,33.2889)){ if (PRESSED(KEY_SECONDARY_ATTACK)){ new file[64]; GetPlayerName (playerid, file, sizeof(file)); format (file, sizeof(file), Conta_Bancaria, file); if(!DOF2_FileExists(file)){ SendClientMessage (playerid, 0xFF0000AA, "Você não tem uma conta bancaria. Vá até uma agência do {FFFF00}Banco do Brasil {FF0000}ou {0080FF}Caixa Economica Federal {FF0000}!"); }}} if(IsPlayerInRangeOfPoint (playerid, 1.0, 246.3607,118.3901,1003.2188)){ if(PRESSED(KEY_SECONDARY_ATTACK)){ ShowPlayerDialog (playerid, DIALOG_MENUBANCO, DIALOG_STYLE_LIST, "Caixa Economica", "Abrir conta\nBeneficios Caixa", "Selecionar","Sair"); }} return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_MENUBANCO){ if(response){ switch(listitem){ case 0:{ new file[64], pname[64], agencia[128]; GetPlayerName (playerid, file, sizeof(file)); GetPlayerName (playerid, pname, sizeof(pname)); format (file, sizeof(file), Conta_Bancaria, file); format (agencia, sizeof(agencia), "Caixa Economica Federal"); if(DOF2_FileExists(file)){ SendClientMessage (playerid, -1, "Você já possui uma conta na Caixa Economica !"); } else if(!DOF2_FileExists(file)){ DOF2_CreateFile(file); DOF2_SetString (file, "Pertencente", pname); DOF2_SetString (file, "Agência", agencia); DOF2_SetInt (file, "Dinheiro", 0); DOF2_SaveFile(); SendClientMessage (playerid, -1, "Agora você tem uma conta na Caixa Economica !"); SendClientMessage (playerid, -1, "Confira seus benefícios e faça um bom aproveito."); }} case 1:{ new string[128]; format (string, sizeof(string), "Você abrindo uma conta na Caixa Economica terá varios deireitos, dentre elas: Sacar em caixas eletronicos, sacar e depositar em lotericas, juros ganho ao pagamento"); ShowPlayerDialog (playerid, DIALOG_ATOA, DIALOG_STYLE_MSGBOX, "Benefícios Caixa Economica", string, "Fecha",""); }}}} return 1; } #endif |
↧
Help dialog
Someone pass me to dialog please?
PHP Code:
if (strcmp(cmd, "/rg", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
ShowStats(playerid,playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Abre a Carteira e confere sua Identidade(RG).", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Você não esta logado !");
}
}
return 1;
}
↧
↧
[Ajuda] API SAMP PHP
Usando essa API http://forum.sa-mp.com/showthread.php?t=355574
Eu consegui pegar algumas informações do meu servidor como:
print_r($query->getBasicPlayers());
Array ( [0] => Array ( [name] => Indio [score] => 6 ) )
print_r($query->getDetailedPlayers());
Array ( [0] => Array ( [playerid] => 0 [nickname] => Indio [score] => 6 [ping] => 15 ) )
Mas como printar essas informações separadas?
Tipo apenas nickname, apenas score, queria colocar dentro de uma tabela pra base de algumas coisas como onlinelist
Eu consegui pegar algumas informações do meu servidor como:
print_r($query->getBasicPlayers());
Array ( [0] => Array ( [name] => Indio [score] => 6 ) )
print_r($query->getDetailedPlayers());
Array ( [0] => Array ( [playerid] => 0 [nickname] => Indio [score] => 6 [ping] => 15 ) )
Mas como printar essas informações separadas?
Tipo apenas nickname, apenas score, queria colocar dentro de uma tabela pra base de algumas coisas como onlinelist
↧
GAMEMODE Update
Hey guys im a old SAMP Player...i had a Server some years ago and i have some Gamemodes but i cant bring them to work idk why... Must i Update the Gamemodes too for the Samp Version?
i Need help...
Thank you in Advance
i Need help...
Thank you in Advance
↧
[Ajuda] Checar dono de um veiculo
Opa, eae raphese!
Bom, eu estou tendo problemas com meu sistema de concessionaria.
Antes de mais nada aqui está o codigo do OnPlayerStateChange:
O problema consiste em:
Em alguns veículos a restrição funciona perfeitamente, em outros não, oque eu percebi foi que são os últimos carros de um certo player(Cada player pode ter 3 carros(com ids diferentes cada um)) que tem o problema de troca de nomes... por ex:
O player Minerva tem 3 veiculos: Bullet(ID:0), Freeway(ID:1) e um Elegy(ID:2)
O player Joao tem 3 veiculos: Buffalo(ID:3), PCJ-600(ID:4) e um Maverick(ID:5)
Lembrando que nos arquivos estão os nomes corretos!
Se eu(Minerva) entrar no Elegy a restrição acusa como se o dono fosse o Joao.
Ou seja, o carro ID2 está como se fosse do Joao e o ultimo Maverick(ID5:5) ambos são donos...
Eu já olhei esse código e realmente estou sem ideias :s XD
Bom, eu estou tendo problemas com meu sistema de concessionaria.
Antes de mais nada aqui está o codigo do OnPlayerStateChange:
PHP Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carro = GetPlayerVehicleID(playerid);
if(strcmp(pNamer(playerid), DOF2_GetString(pConce(carro), "Dono"), false))
{
new str[128];
format(str, sizeof(str), "Esse veiculo não é seu. Seu dono é: %s", DOF2_GetString(pConce(carro), "Dono"));
SendClientMessage(playerid, VERMELHO, str);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
if(!strcmp(pNamer(playerid), DOF2_GetString(pConce(carro), "Dono"), false))
{
SendClientMessage(playerid, -1, "Bem-vindo esse veiculo é seu!");
}
}
return 1;
}
Em alguns veículos a restrição funciona perfeitamente, em outros não, oque eu percebi foi que são os últimos carros de um certo player(Cada player pode ter 3 carros(com ids diferentes cada um)) que tem o problema de troca de nomes... por ex:
O player Minerva tem 3 veiculos: Bullet(ID:0), Freeway(ID:1) e um Elegy(ID:2)
O player Joao tem 3 veiculos: Buffalo(ID:3), PCJ-600(ID:4) e um Maverick(ID:5)
Lembrando que nos arquivos estão os nomes corretos!
Se eu(Minerva) entrar no Elegy a restrição acusa como se o dono fosse o Joao.
Ou seja, o carro ID2 está como se fosse do Joao e o ultimo Maverick(ID5:5) ambos são donos...
Eu já olhei esse código e realmente estou sem ideias :s XD
↧