Quantcast
Channel: SA-MP Forums
Viewing all 18226 articles
Browse latest View live

ycmd problem

$
0
0
i have ycmd, how to send a messaage to a player if he write a performed command?

Drift Track.

Char arrays

$
0
0
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.

does not match definition

$
0
0
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 202: number of arguments does not match definition
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

$
0
0
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

Suspect file/folder name in SAMP directory

$
0
0
Someone know the suspect file/folder name into SAMP directory for verification?

Examples (basic):
[folder] mod_sa
[folder] cleo
[file] mod_sa.*
[file] [*.cs]

Is there any UCP / Shop released template available?

$
0
0
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.

[MAP]Police Departament LS + rescue

$
0
0
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

[Ajuda] input line too long (after substitutions)

$
0
0
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.

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.

O .lang abaixo:

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"

Eu já vasculhei quase todos os tópicos que contém esse erro, eu já baixer o compilador Zeex.

uundefined symbol "CMDMessageToVips"

$
0
0
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

[FilterScript] House System * C-HOUSE

$
0
0
• 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


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.361049.0294.00106},
    {
2259.38, -1135.891050.64275.399210},
    {
2282.99, -1140.281050.89358.466011},
    {
2233.69, -1115.261050.88358.46605},
    {
2218.39, -1076.211050.4895.26351},
    {
2496.00, -1692.081014.74177.81593},
    {
2365.25, -1135.581050.88359.03678},
    {
2317.77, -1026.761050.21359.03679},
    {
2324.41, -1149.541050.71359.036712},
    {
1260.6603, -785.40051091.9063270.98915},
    {
140.281365.921083.859.69015}
};

// 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 
0MAX_HOUSE; ++i)
    {
        
DestroyDynamicPickup(c[i][cPickup]);
        
DestroyDynamicMapIcon(c[i][cIcon]);
        
DestroyDynamic3DTextLabel(c[i][cText]);
    }    
    return 
1;
}

public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridp[playerid][Name], 24);
    
LoadPlayer(playerid);
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    if(
p[playerid][HasHouse] > 0SavePlayer(playerid);
    return 
1;
}





// ============= COMMANDS ADMIN
CMD:ahouse(playerid)
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridRED"Command restricted to administrators.");

    new 
String_COMANDOS[220]; //
    
format(String_COMANDOSsizeof 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(playerid9545DIALOG_STYLE_MSGBOX"Commands Admin C-HOUSE"String_COMANDOS"Ok""");
    return 
1;
}

CMD:createhouse(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridRED"Command restricted to administrators.");
    if(
sscanf(params"ii"params[0], params[1])) return SendClientMessage(playeridCINZA"Use /createhouse [price] [int 0a10]");

    
Create_House(playeridTotalHouse+1params[0], params[1]);
    return 
1;
}

CMD:gohouse(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridRED"Command restricted to administrators.");
    if(
sscanf(params"i"params[0])) return SendClientMessage(playeridCINZA"Use /gohouse [id]");

    
Go_House(playeridparams[0]);
    return 
1;
}

CMD:edithouse(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridRED"Command restricted to administrators.");
    if(
sscanf(params"iii"params[0], params[1], params[2])) return SendClientMessage(playeridCINZA"Use /edithouse [id] [price] [int 0a10]");

    
Edit_House(playeridparams[0], params[1], params[2]);
    return 
1;
}

CMD:deletehouse(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridRED"Command restricted to administrators.");
    if(
sscanf(params"i"params[0])) return SendClientMessage(playeridCINZA"Use /deletehouse [id]");

    
Delete_House(playeridparams[0]);
    return 
1;
}






// ================= COMMANDS PLAYERS

/*CMD:money(playerid)
{
    GivePlayerMoney(playerid, 500000);
    return 1;
}
*/

CMD:buyhouse(playerid)
{
    for(new 
0MAX_HOUSEi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid1c[i][cX], c[i][cY], c[i][cZ]))
        {
            if(
p[playerid][HasHouse] > 0) return SendClientMessage(playeridRED"You already own a house..");
            if(
c[i][cOccupied] == 1) return SendClientMessage(playeridRED"This house already owns.");
            if(
GetPlayerMoney(playerid) < c[i][cPrice]) return SendClientMessage(playeridRED"Insufficient moneye.");

            
format(c[i][cOwner], 24p[playerid][Name]);
            
c[i][cOccupied] = 1;
            
p[playerid][HasHouse] = i;
            
SendClientMessage(playeridORANGE"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(1952221c[i][cX], c[i][cY], c[i][cZ]);//1272
            
            
format(textosizeof(texto), "{B22222}HOUSE ID: {FFFFFF}%d\n{CD5C5C}Owner: {FFFFFF}%s\n{CD5C5C}Price: {FFFFFF}$ %d{CD5C5C}\n/helphouse"ic[i][cOwner], c[i][cPrice]);
            
c[i][cText] = CreateDynamic3DTextLabel(texto0xFFFFFFAAc[i][cX], c[i][cY], c[i][cZ]+120);

            new 
Query[80];
            
format(Querysizeof(Query), "UPDATE HOUSES SET OWNER ='%s', OCCUPIED = 1 WHERE ID =%d"c[i][cOwner], i);
            
db_query(DatabaseQuery);
            break;
        }
    }
    return 
1;
}

CMD:sellhouse(playerid)
{
    for(new 
0MAX_HOUSEi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid1c[i][cX], c[i][cY], c[i][cZ]))
        {
            if(
p[playerid][HasHouse] == 0) return SendClientMessage(playeridRED"You do not own a house.");
            if(
c[i][cOccupied] == 0) return SendClientMessage(playeridRED"This house does not have an owner.");
            if(
p[playerid][HasHouse] == i)
            {
                
SendClientMessage(playeridORANGE"House sold successfully.");
                
GivePlayerMoney(playeridc[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(127321c[i][cX], c[i][cY], c[i][cZ]);

                
format(textosizeof(texto), "{2E8B57}HOUSE ID: {FFFFFF}%d\n{3CB371}Owner: {FFFFFF}%s\n{3CB371}Price: {FFFFFF}$ %d\n{3CB371}Press 'F' to enter\n/helphouse"ic[i][cOwner], c[i][cPrice]);
                
c[i][cText] = CreateDynamic3DTextLabel(texto0xFFFFFFAAc[i][cX], c[i][cY], c[i][cZ]+120);

                new 
Query[80];
                
format(Querysizeof(Query), "UPDATE HOUSES SET OWNER ='%s', OCCUPIED = 0 WHERE ID =%d"c[i][cOwner], i);
                
db_query(DatabaseQuery);
                break;

                } else {

                
SendClientMessage(playeridRED"This house is not yours.");
                return 
1;
               }
        }
    }
    return 
1;
}

CMD:lock(playerid)
{
    for(new 
0MAX_HOUSEi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid1c[i][cX], c[i][cY], c[i][cZ]))
        {
            if(
p[playerid][HasHouse] == 0) return SendClientMessage(playeridRED"You do not own a house.");
            if(
c[i][cOccupied] == 0) return SendClientMessage(playeridRED"This house does not have an owner.");
            if(
p[playerid][HasHouse] == i)
            {
                new 
Query[80];
                if(
c[i][cLocked] == 0)
                {
                    
SendClientMessage(playeridORANGE"Locked house.");
                    
c[i][cLocked] = 1;
                    
                    
format(Querysizeof(Query), "UPDATE HOUSES SET LOCKED = 1 WHERE ID =%d"i);
                    
db_query(DatabaseQuery);
                    break;
                    
                    } else {
                    
                    
SendClientMessage(playeridORANGE"Unlocked house.");
                    
c[i][cLocked] = 0;
                    
                    
format(Querysizeof(Query), "UPDATE HOUSES SET LOCKED = 0 WHERE ID =%d"i);
                    
db_query(DatabaseQuery);
                    break;
                }
                } else {

                
SendClientMessage(playeridRED"This house is not yours.");
                return 
1;
               }
        }
    }
    return 
1;
}

CMD:helphouse(playerid)
{
    
ShowPlayerDialog(playerid9595DIALOG_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(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_SECONDARY_ATTACK// KEY F
    
{
        for(new 
0MAX_HOUSEx++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1c[x][cX], c[x][cY], c[x][cZ]))
            {
                if(
c[x][cOccupied] == 0)
                {
                    
SetPlayerPos(playeridinterior[c[x][cInt]][iX], interior[c[x][cInt]][iY], interior[c[x][cInt]][iZ]);
                    
SetPlayerFacingAngle(playeridinterior[c[x][cInt]][iA]);
                    
SetPlayerInterior(playeridinterior[c[x][cInt]][iID]);
                    
p[playerid][EnterHouse] = x;
                    
                    
SendClientMessage(playeridORANGE"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] == && p[playerid][HasHouse] != x) return SendClientMessage(playeridRED"Locked house.");
                    
                    if(
p[playerid][HasHouse] == x)
                    {
                        
SetPlayerPos(playeridinterior[c[x][cInt]][iX], interior[c[x][cInt]][iY], interior[c[x][cInt]][iZ]);
                        
SetPlayerFacingAngle(playeridinterior[c[x][cInt]][iA]);
                        
SetPlayerInterior(playeridinterior[c[x][cInt]][iID]);
                        
p[playerid][EnterHouse] = x;
                        
                        
SendClientMessage(playeridORANGE"Welcome to your home. Use 'N' to exit.");
                        break;
                        
                        } else {

                        
SendClientMessage(playeridRED"This house is not yours.");
                        return 
1;
                    }
                }
            }
        }
    }

    if(
newkeys == 131072// KEY N
    
{
        if(
p[playerid][EnterHouse] > 0)
        {
            
SetPlayerPos(playeridc[p[playerid][EnterHouse]][cX], c[p[playerid][EnterHouse]][cY], c[p[playerid][EnterHouse]][cZ]);
            
SetPlayerInterior(playerid0);
            
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(Querysizeof(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(DatabaseQuery);

    
format(Querysizeof(Query), "CREATE TABLE IF NOT EXISTS OWNERS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NOME TEXT DEFAULT '', CASAID INTEGER DEFAULT 0)");    
    
db_query(DatabaseQuery);

    return 
1;
}

LoadPlayer(playerid)
{
    new 
DBResult:ResultQuery[65];
    
format(Querysizeof(Query), "SELECT * FROM OWNERS WHERE NOME = '%s'"p[playerid][Name]);
    
Result db_query(DatabaseQuery);

    if(
db_num_rows(Result))
    {
        
p[playerid][HasHouse] = db_get_field_assoc_int(Result"CASAID");

        } else {

        new 
Query2[75];
        
format(Query2sizeof(Query2), "INSERT INTO OWNERS (NOME, CASAID) VALUES ('%s', 0)"p[playerid][Name]);
        
db_query(DatabaseQuery2);

        
p[playerid][HasHouse] = 0;
    }
    
db_free_result(Result);
    return 
1;
}

SavePlayer(playerid)
{
    new 
Query[75];
    
format(Querysizeof(Query), "UPDATE OWNERS SET CASAID =%d WHERE NOME ='%s'"p[playerid][HasHouse], p[playerid][Name]);
    
db_query(DatabaseQuery); 
    return 
1;
}




// ============== INIT
LoadHouse()
{
    new 
DBResult:ResultQuery[50];
    for(new 
0MAX_HOUSEi++)
    {
        
format(Querysizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d"i);
        
Result db_query(DatabaseQuery);

        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(127321c[i][cX], c[i][cY], c[i][cZ]);

        
format(textosizeof(texto), "{2E8B57}HOUSE ID: {FFFFFF}%d\n{3CB371}Owner: {FFFFFF}%s\n{3CB371}Price: {FFFFFF}$ %d\n{3CB371}Press 'F' to enter\n/helphouse"ic[i][cOwner], c[i][cPrice]);
        
c[i][cText] = CreateDynamic3DTextLabel(texto0xFFFFFFAAc[i][cX], c[i][cY], c[i][cZ]+120);
    }
    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(1952221c[i][cX], c[i][cY], c[i][cZ]);//1272

        
format(textosizeof(texto), "{B22222}HOUSE ID: {FFFFFF}%d\n{CD5C5C}Owner: {FFFFFF}%s\n{CD5C5C}Price: {FFFFFF}$ %d{CD5C5C}\n/helphouse"ic[i][cOwner], c[i][cPrice]);
        
c[i][cText] = CreateDynamic3DTextLabel(texto0xFFFFFFAAc[i][cX], c[i][cY], c[i][cZ]+120);
    }
    return 
1;
}






// ============== ADMIN
Create_House(playerididprecointe)
{
    new 
DBResult:ResultQuery[160];
    
format(Querysizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d"id);
    
Result db_query(DatabaseQuery);

    if(
db_num_rows(Result))
    {
        
SendClientMessage(playeridRED"Error.");

        } else {

        new 
Float:Pos[3];
        
GetPlayerPos(playeridPos[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(playeridORANGE"House created successfully.");
        
CreateHouse(id);

        
format(Querysizeof(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(DatabaseQuery);

        
TotalHouse ++;
    }
    
db_free_result(Result);
    return 
1;
}

Edit_House(playerididprecointeri)
{
    new 
DBResult:ResultQuery[50];
    
format(Querysizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d"id);
    
Result db_query(DatabaseQuery);

    if(
db_num_rows(Result))
    {
        new 
string[60];
        
format(stringsizeof(string), "You have successfully edited the house id %d"id);
        
SendClientMessage(playeridORANGEstring);    

        
c[id][cPrice] = preco;
        
c[id][cInt] = interi;

        
DestroyDynamicPickup(c[id][cPickup]);
        
DestroyDynamicMapIcon(c[id][cIcon]);
        
DestroyDynamic3DTextLabel(c[id][cText]);

        
CreateHouse(id);

        } else {

        
SendClientMessage(playeridRED"Error.");
    }
    
db_free_result(Result);
    return 
1;
}

Go_House(playeridid)
{
    new 
DBResult:ResultQuery[50];
    
format(Querysizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d"id);
    
Result db_query(DatabaseQuery);

    if(
db_num_rows(Result))
    {
        new 
string[60];
        
format(stringsizeof(string), "You went home id %d."id);
        
SendClientMessage(playeridORANGEstring);    

        
SetPlayerPos(playeridc[id][cX], c[id][cY], c[id][cZ]);
        
SetPlayerInterior(playerid0);

        } else {

        
SendClientMessage(playeridRED"Error.");
    }
    
db_free_result(Result);
    return 
1;
}

Delete_House(playeridid)
{
    new 
DBResult:ResultQuery[50];
    
format(Querysizeof(Query), "SELECT * FROM HOUSES WHERE ID = %d"id);
    
Result db_query(DatabaseQuery);

    if(
db_num_rows(Result))
    {
        
format(Querysizeof(Query), "DELETE FROM HOUSES WHERE ID = %d"id);
        
db_query(DatabaseQuery);

        new 
string[60];
        
format(stringsizeof(string), "You have successfully deleted the house id %d"id);
        
SendClientMessage(playeridORANGEstring);    

        
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(playeridRED"Error.");
    }
    
db_free_result(Result);
    return 
1;




• Credits

Includes creators.
Cleyson by total code creation


◘ Sorry my bad english. :*

A Command!

$
0
0
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(playeridparams[])
{
     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(targetid3);
            
SetPlayerColor(targetidYELLOW);
            
GameTextForPlayer(targetid"~Y~ESCAPED FROM ~G~ARRESTED ~P~ RUN BABY!!!"70005);
            
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

$
0
0
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;
}

[Ajuda] Ajuda Comando

$
0
0
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 
iMAX_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;


Alguém me ajuda a ver ser esse comando está certo.

Detect wheels

$
0
0
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

$
0
0

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

$
0
0
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(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* %s Abre a Carteira e confere sua Identidade(RG)."sendername);
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"   Você não esta logado !");
            }
        }
        return 
1;
    } 

[Ajuda] API SAMP PHP

$
0
0
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

GAMEMODE Update

$
0
0
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

[Ajuda] Checar dono de um veiculo

$
0
0
Opa, eae raphese!

Bom, eu estou tendo problemas com meu sistema de concessionaria.

Antes de mais nada aqui está o codigo do OnPlayerStateChange:

PHP Code:

public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
carro GetPlayerVehicleID(playerid);
        if(
strcmp(pNamer(playerid), DOF2_GetString(pConce(carro), "Dono"), false))
        {
            new 
str[128];
            
format(strsizeof(str), "Esse veiculo não é seu. Seu dono é: %s"DOF2_GetString(pConce(carro), "Dono"));
            
SendClientMessage(playeridVERMELHOstr);
            
RemovePlayerFromVehicle(playerid);
            
TogglePlayerControllable(playerid1);
        }
        if(!
strcmp(pNamer(playerid), DOF2_GetString(pConce(carro), "Dono"), false))
        {
            
SendClientMessage(playerid, -1"Bem-vindo esse veiculo é seu!");
        }
    }
    return 
1;


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
Viewing all 18226 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>