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

AIM Camera GTA 5 on SAMP

$
0
0
Is it possible to do something like this:
Kinda of zoom when players aim with a weapon...
https://www.youtube.com/watch?v=DR88uVEiRa8
Only by using SAMP functions (server side)

I saw some people doing first person on SAMP (server side)
Like this: https://forum.sa-mp.com/showthread.php?t=596916
with https://wiki.sa-mp.com/wiki/AttachCameraToObject

I would love play a server where everybody got this aim camera

Someone know if its possible?

pawn Code:
#define PRESSING(%0,%1) \
    (%0 & (%1))
   
// RELEASED(keys)
#define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))



public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        new wid = GetPlayerWeapon(playerid);
        if(wid == 24 || wid == 25 || wid == 27 || wid == 29 || wid == 30 || wid == 31 || wid == 33)
        {
            if(PRESSING(newkeys, KEY_AIM )) SetGTAVAIM(playerid);
            else if(RELEASED(KEY_AIM)) RemoveGTAVAIM(playerid);
        }
    }
}


public SetGTAVAIM(playerid) {
    ???
}

public RemoveGTAVAIM(playerid) {
    ???
}

New MoveObject by Deleting and Creating

$
0
0
The normal MoveObject is this:
pawn Code:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)

I want a base to recreate this function by create a new function MoveObjectEx:
who destroy the object and recreate with a timer like it was moving the object

I need as base to do another things, if anyone know how to do that?

MYSQL Syntax

$
0
0
when i try to chat, i mean only simple chat it gives me this in serverlog
[13:27:26]
PHP Code:

====================================================================
[
13:27:26Error ID1064, * EroareYou have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near '21/04/2020 - 13:27:26''9''xx.xx.xx.xx')' at line 1
[13:27:26] Callback: 
[13:27:26] gQuery: INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('
2', '(chatthis is a test\', '21/04/2020 13:27:26', '9', 'xx.xx.xx')
[13:27:26] ==================================================================== 

only because i have this slash
(chat) this is a test\

does somebody know how can i get rid of this ?

PHP Code:

function InsertLog(playeridtext[], type) {
    new 
        
szQuery[1024], szDate[180], YearMonthDayHourMinuteSecondip[180];
        
    
getdate(YearMonthDay);
    
gettime(HourMinuteSecond);
    
GetPlayerIp(playeridipsizeof(ip));
    
format(szDatesizeof(szDate), "%02d/%02d/%d - %02d:%02d:%02d"DayMonthYearHourMinuteSecond); 
    
mysql_format(SQLszQuerysizeof(szQuery), "INSERT INTO `logs` (`Userid`, `Text`, `Date`, `Type`, `IP`) VALUES ('%d', '%s', '%s', '%d', '%s')"PlayerInfo[playerid][pSQLID], textszDatetypeip);
    
mysql_tquery(SQLszQuery"""");                
    return 
true;


[Tool/Web/Other] SA:MP C# Control Panel

$
0
0
Hello guys, i just made a control panel c# and samp api.
Pictures:
https://imgur.com/a/pc7zOJD
Features:
- Run server
- Stop server
- Restart server
- Anti RakSamp
- Anti Flood
- Change hostname
- Change server password
- Change server website url
- Load/Unload filterscripts
- Change max npc can connect to server
- Enable logging (Sqllite-Chats-Queries-Sqllite-Queries)

Notes:
You should put it in your samp-server folder.
You shouldn't disable the rcon.

Download:
Github

not saving properly

$
0
0
Hello,

I have a system of saving accounts, everything works well but many times, when closing the server or restarting it, i lose the skin and the admin level, I do not know why this happens.

OnPlayerDiscconect:

PHP Code:

AccSave(playerid); 

AccSave:

PHP Code:

stock AccSave(playerid)
{
    new 
query[200];
    
mysql_format(dbquerysizeof(query), "UPDATE `accounts` SET `Admin` = '%d', `Skin` = '%d', `Kills` = '%d', `Deaths` = '%d' WHERE `ID` = %d"PlayerInfo[playerid][Admin], PlayerInfo[playerid][Skin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][ID]);
    
mysql_tquery(dbquery);
    
printf("`Admin` = '%d', `Skin` = '%d', `Kills` = '%d', `Deaths` = '%d' WHERE 'ID' = %d"PlayerInfo[playerid][Admin], PlayerInfo[playerid][Skin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][ID]);


OnGameModeExit:

PHP Code:

public OnGameModeExit()
{
    for(new 
i=1;i<=MAX_PLAYERS;i++)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][Logged] == 1)
        {
            
AccSave(i);
        }
    }
    for(new 
i=1;i<=MAX_VEHICLES;i++) DestroyVehicle(i);
    return 
1;


Logged doesn't affect, as I didn't have that if before and the same thing kept happening to me. If I don't close the server and connect again, I get the skin and admin well. It only happens when I restart or close the server.

Thanks!

Actor Name & Actor chatbubble

$
0
0
i have trying using THIS include so i can play around with actors. but it is not working...
PHP Code:

//-----------------------------------------------
    
SweetQ CreateDynamicActor(270,2177.3374,-982.3736,64.4688,167.8236169.0, -1, -1, -1);
    
SetActorName(SweetQ,"Sweet");
    
ApplyDynamicActorAnimation(SweetQ"COP_AMBIENT""Coplook_loop"4.00111, -1);
    
Attach3DTextLabelToActor(SweetQ"Psst...\nAm nevoie de ajutorul tau!\nApasa {FFFF00}'Y'{FFFFFF} pentru a vorbi cu mine!"0xFFFFFFFF2177.3374,-982.3736,64.468815.0, -10);
    
//SetActorChatBubble(SweetQ, "Psst...\nAm nevoie de ajutorul tau!\nApasa {FFFF00}'Y'{FFFFFF} pentru a vorbi cu mine!", COLOR_WHITE, 15, 0);
//----------------------------------------------- 

From those lines only CreateDynamicActor and applying his animation work.
The others dont work because it is a dynamic actor and not a non-dynamic one?

i am trying now to make it with CreateActor

EDIT: I have tried with CreateActor and simple apply and works.
What is the difference between the normal & the dynamic ones.
I know that the dynamic ones are streamed only when you are in their range.
How can i adapt that include to my DynamicActors? is it a way?

Showing polish characters

$
0
0
Hello there!
I have a problem and I don't know how to solve it. Im from Poland, and I use plugin called 'discord-connector' to connect my server with Discord server which I have prepared for server.

When I'm trying to send message from server to my Discord server using discord BOT which I prepared before polish characters (ą, ź, ć, ó, ł etc.) message doesn't appear in Discord channel.

Below I attach code which im using to send messages to discord.

pawn Code:
stock discord(DCC_Channel:channelid, text[], {Float, _}:...)
{
    new out[1024];
    va_format(out, sizeof out, text, va_start<2>), utf8encode(text, out);
    DCC_SendChannelMessage(channelid, out);
    return 1;
}

pawn Code:
discord(samp_admin, "[a-chat] (%s) %s:%s", GetAdminRank(playerid), GetPlayerNick(playerid), text[1]);

Next, I have problem with sending messages from server to Discord, same kind of problem. Polish characters become bushes. Below I attach my code for sending messages from server to Discord.

pawn Code:
forward DCC_OnMessageCreate(DCC_Message:message);
public DCC_OnMessageCreate(DCC_Message:message)
{
    new msg[100], bool:is_bot, DCC_User:author, author_name[33], DCC_Channel: channel_id;
   
    DCC_GetMessageContent(message, msg, 100), DCC_GetMessageChannel(message, channel_id), DCC_GetMessageAuthor(message, author);
    DCC_IsUserBot(author, is_bot);
   
    if(channel_id == samp_chat && !is_bot)
    {
        DCC_GetUserName(author, author_name, 32);
        SCMToAll(0x6f8cceff, "[Discord] {6fce92}%s: {FFFFFF}%s", author_name, msg);
    }
    return 1;
}

I use strlib.inc by Slice to decode/encode but this is not working for me, messages don't get encoded in UTF-8...

pawn Code:
stock convert_encoding(string[])
{
    new original[50] = {192,193,194,196,198,199,200,201,202,203,204,205,206,207,210,211,212,214,217,218,219,220,223,224,225,226,228,230,231,232,233,234,235,236,237,238,239,242,243,244,246,249,250,251,252,209,241,191,161,176};
    new fixed[50] = {128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,94,124};
    new len = strlen(string);
    for (new i; i < len; i++) {
        for(new j;j < 50;j++) {
            if(string[i] == original[j]) {
                string[i] = fixed[j];
                break;
            }
        }
    }
}

and im using that function from forums but this as well don't give needed result.
Do anybody knows how to solve that problem? I made my research using github issues thread and nothing worked.
Thanks in advice. ;).

Players No Found

$
0
0
For example, I am typing / ban 8, I get an error not found player. But the player is in the game.


But it accepts the same command when typing / ban 5. In other words, it perceives some players and not others.


I updated SSCANF. It is not again.

Please HELP :)

PORT FORWARD

$
0
0
how can i port forward my server for beta testing. from my Router its Virtual Server i typed it all and nothing happens.

[Ajuda] Coordenadas da Tela para TextDraw

$
0
0
Olá! Gostaria de saber qual FS, ou Programa possa me mostrar as coordenadas da tela para adicionar uma texdrawn em determinado local.

Case dialog_inventory with a for loop

$
0
0
Hey guys, I am having an issue. I am making a dialog inventory system. (since i got some problems with the textdraw one).

I've got some error here, how should i fix that?

PHP Code:

switch(listitem)
            {
                for(new 
iMAX_INVENTORY_SLOTSi++)
                {
                    case 
i//error here, how do i fix it?
                    
{
                        if(
JatekosInfo[playerid][InvSlotDB][i] == 0) return SCM(playerid, -1,"A slot üres!");
                        
selectedslot[playerid] = i;
                        
ShowPlayerDialog(playeridDIALOG_INVENTORY2DIALOG_STYLE_LIST,string,"Használ\nEldob\nÁtad");
                    }
                }
            } 

I've got loads of warnings and 4 errors about YSI-Storage bla bla "local variable "i" shadows a variable at a preceding level" and "undefined symbol: i" etc..

Thank you for your help

Help!

$
0
0
i can't use script i had only .pwn file only, and how can install script from pastebin

[FilterScript] CRATE SYSTEM

[Ajuda] COMANDO /PRENDER

$
0
0
bom sou novo por aq no forum e faz 2 semanas que mecho com pawno alguem poderia me ajudar em questao dum comando, o /prender tipo getar o nivel d eprocurado e dar tal tempo exemplo 1 estrela 10 minutos e ser apenas /prender [id] e nao ter q dar /prender [id] [tempo] etc... de preferencia com o zcmd
obrigado!

Íóæíà ïîìîùü â ñîçäàíèè äèíàìè÷åñêèõ çîí

$
0
0
Âñåì ïðèâåò.
Õî÷ó ñäåëàòü äèíàìè÷åñêóþ çîíó èìåÿ òîëüêî êîîðäèíàòû èãðîêà.
Òîåñòü áðàòü êîîðäèíàòû èãðîêà ÷åçåç ôóíêöèþ GetPlayerPos äàëåå ñîçäàâàòü êâàäðàò íà êàðòå.

[Map] FBI Building Interior/ HitmanHq | Mirsat24

I need help with DynamicArea

$
0
0
Hi all,
How to make DynamicArea using only GetPlayerPos? i mean when u in game and u need to create square (DynamicArea) wheres the person staying.

Scripting help *Admin >Online *

$
0
0
: error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


CMD:admins(playerid, params[])
{
new count = 1, name[24], string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pAdminLevel] != 0)
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s%s: %s\n", string, GetPlayerAdminRank(i), name);
count ++;
}
}

if(count > 0)
{
ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
}
else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
return 1;
}

FCNPC AND COLANDREAS

$
0
0
Hello, I am working with the NPCs and I realize that when an NPC follows a player but the player is on the roof of a building, the npc goes to the highest position of the building, I use the function of the maps that comes in the FCNPC.

What I want to do is that when the NPC detects that the player is in the building it just stays at the Z coordinate of the floor, not the ceiling.
It seems to me that with ColAndreas it is possible to do this with collisions, but I don't have a good idea of ​​how to do this.

Could someone give me an idea of ​​how to do this?

[Off] Fim dos tempos - SAMP

$
0
0
Fala pessoal, tudo tranquilo ? Então, eu fiquei um bom tempo sem jogar samp por motivos pessoais, e agora que voltei a ter tempo encontrei um SAMP completamente horrível, desculpem o modo de dizer, mas os servidores estão cheios de jogadores novos conectados via android, está uma tremenda poluição, um flood horrivel, uma bagunça da porra em todos os servidores, e estava dando uma olhada aqui na board, está completamente abandonada ...

É, acho que o SAMP está chegando ao fim !

Com esses jogadores bagunceiros via android vai acabar de vez com o samp.
duvido a galera continuar pagando pra jogar em servidores com 500 jogadores, 400 desses via android de 10 anos de idade .... triste !
Viewing all 18226 articles
Browse latest View live


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