Quantcast
Viewing all 18226 articles
Browse latest View live

question about showing textdraws

pawn Code:
for(new textdrawid; textdrawid != 5; textdrawid ++) TextDrawShowForPlayer(playerid, achievementTD[textdrawid]);

or

pawn Code:
TextDrawShowForPlayer(playerid, achievementTD[0]);
TextDrawShowForPlayer(playerid, achievementTD[1]);
...

thanks a lot for all answers. sorry for my bad english :(

Anyone have pawn-lang.pdf?

Hello!
Do anyone have pawn-lang.pdf from Y-less' website (his website is down as I can see)?
Thank you!

FCNPC Shutting down server

I've been trying to learn more about FCNPC and just started making an edit of this filter script: https://forum.sa-mp.com/showthread.php?t=637336 .

The problem is that when I start the server and go in-game, after a while or whenever I kill an NPC, the samp-server.exe just closes. No error messages or anything, I even got crashdetect to see if any messages could have popped up. Any clues what might be causing this?

The FCNPC plugin/include is up to date, also MapAndreas. I'm using the 0.3.DL SA-MP version.
Repping anyone that helps!

This is the code I got so far:

Code:

public OnFilterScriptInit()
{

        MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
        FCNPC_InitMapAndreas(MapAndreas_GetAddress());
       
        ServerData[spawned_npcs] = 0;
        SpawningNPCTimer = SetTimer("SpawnNPC", 5000, true);
       
        return 1;
}

forward SpawnNPC();
public SpawnNPC()
{
        new Random = random(sizeof(SpawnLocations));
        new string[MAX_PLAYER_NAME];
        new botid = ServerData[spawned_npcs];
        new targetnpc;
        if(ServerData[spawned_npcs] < MAX_NPCS)
        {
            format(string,sizeof(string), "NPC_%i", botid + 1);
            targetnpc = FCNPC_Create(string);
            FCNPC_Spawn(targetnpc,133,SpawnLocations[Random][0],SpawnLocations[Random][1],SpawnLocations[Random][2]);
            FCNPC_SetInterior(targetnpc, 0);
            FCNPC_SetVirtualWorld(targetnpc, 0);
            FCNPC_SetHealth(targetnpc, 100);
            FCNPC_SetWeapon(targetnpc, 1);
           
            ServerData[spawned_npcs]++;
        }
        else
        {
            KillTimer(SpawningNPCTimer);
            printf("Maximum NPCs spawned, totals to: %i", ServerData[spawned_npcs]);
        }
        return 1;
}

Help which option is better?

Option 1:

Code:

stock vehicle_getBoot(vehicleid) {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        return boot == 1;
}
stock vehicle_setBoot(vehicleid, boot) {
        new engine, lights, alarm, doors, bonnet, ParamNone, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, ParamNone, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
stock veh_getEngine(vehicleid) {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        return engine == 1;
}
stock vehicle_setEngine(vehicleid, engine) {
        new ParamNone, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, ParamNone, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
stock vehicle_getBonnet(vehicleid) {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        return bonnet == 1;
}
stock vehicle_setBonnet(vehicleid, bonnet) {
        new engine, lights, alarm, doors, ParamNone, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, ParamNone, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
stock vehicle_getLights(vehicleid) {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        return lights == 1;
}
stock vehicle_setLights(vehicleid, lights) {
        new engine, ParamNone, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, ParamNone, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}
stock vehicle_getDoors(vehicleid) {
        new engine, lights, alarm, doors, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        return doors == 1;
}
stock vehicle_setDoors(vehicleid, doors) {
        new engine, lights, alarm, ParamNone, bonnet, boot, objective;
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, ParamNone, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
}

or Option 2:
Code:

enum Global_Vehicle{
        global_vehicle_ENGINE,
        global_vehicle_LIGHTS,
        global_vehicle_DOORS,
        global_vehicle_BONNET,
        global_vehicle_BOOT,
        global_vehicle_OBJECTIVE,
        global_vehicle_ALARM
};
new GlobalVehicle[MAX_VEHICLES][Global_Vehicle];

VehicleParamsUpdate(vehicleid)
{
        SetVehicleParamsEx(vehicleid, GlobalVehicle[vehicleid][global_vehicle_ENGINE], GlobalVehicle[vehicleid][global_vehicle_LIGHTS], GlobalVehicle[vehicleid][global_vehicle_ALARM], GlobalVehicle[vehicleid][global_vehicle_DOORS], GlobalVehicle[vehicleid][global_vehicle_BONNET], GlobalVehicle[vehicleid][global_vehicle_BOOT], GlobalVehicle[vehicleid][global_vehicle_OBJECTIVE]);
        return 1;
}

In option 2 the status would be checked directly from the variables, example:
Code:

if(GlobalVehicle[vehicleid][global_vehicle_ENGINE] == value) { // Code }

Create Dialog

How do I do something like this (image) choose team after registering / login

Image may be NSFW.
Clik here to view.


GM: from 0 100 lines I have

Open source dev.

I have some commitment issues (it's just one of many others) and i can't finish any of my projects. I have a .txt file named "Good ideas that i will never put it to work".

So i was wondering start an open-source gamemode development, because i know there are a lot of us out there and we could help eachother out or nah

What are your thoughts about open-source gamemode development?

[FilterScript] Sistema de politica v1.0

[Off] Windows

Gente, eu tinha o windows starter 32 bits, com 2 gb ram.

ai comprei uma memoria de 4gb
instalei, fiquei com 6 gb de ram ( mas somente 2 gb utilizável )
fui no executar - msconfig - desabilitei memoria maxima e nada.

descobri que windows 32 bit não suporta mais de 4gb.
atualizei meu windows para a versao home premium

agora tenho 3.5 gb utilizável de RAM.

para eu poder utilizar os 6 GB terei que passar meu sistema para 64 bits ?
baixei um arquivo ISO do windows 10 64 bits.
na hora de executar o instalador da erro, diz que não é compatível com meu sistema.

então como vou converter para 64 bits ? tenho que passar a ISO para o pendrive e iniciar no boot pelo pendrive ?
isso daria certo ?

eu ficaria com o windows 10 64 bits com 6 GB RAM ?

fixes.inc

There seems to be an issue with fixes.inc which is causes my server to fail to start. Basically the issue is that I don't have it included and my server works fine. The thing is that once I do include it, it fails and nativechecker informs me of the following:

Image may be NSFW.
Clik here to view.


Any fixes? The only SA-MP forum topic I could find for this was in Russian.

stock,public,what's the diffierent?

:confused:
please give me a answer

help

Code:

C:\Users\PC01\Desktop\lsgw\filterscripts\AS.pwn(1261) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\PC01\Desktop\lsgw\filterscripts\AS.pwn(1285) : warning 219: local variable "str" shadows a variable at a preceding level

first code
Code:

CMD:kick(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
        {
        new PID; //define the playerid we wanna kick
        new reason[64]; //the reason, put into a string
        new str[128]; //a new message string
        new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
        GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
        GetPlayerName(PID, Playername, sizeof(Playername));
        if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
        if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
        return SendClientMessage(playerid, -1, "Player is not connected!");
        format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
        SendClientMessageToAll(-1, str); //send that message to all
        Kick(PID); //kick the playerid we've defined
    }
    else //if he has not got the permissions
    {
        SendClientMessage(playerid, -1, "You have to be level 2 to use that command!"); //return this message
    }
    return 1;
}



second code
Code:

CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
        {
        new PID; //define the playerid we wanna ban
        new reason[64]; //the reason, put into a string
        new str[128]; //a new message string
        new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
        GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
        GetPlayerName(PID, Playername, sizeof(Playername));
        if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, -1, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
        if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
        return SendClientMessage(playerid, -1, "Player is not connected!");
        format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
        SendClientMessageToAll(-1, str); //send that message to all
        Ban(PID); //Ban the playerid we've defined
    }
    else //if he has not got the permissions
    {
        SendClientMessage(playerid, -1, "You have to be level 5 to use that command!"); //return this message
    }
    return 1;
}

ApplyActorAnimation crashes my game

Im making my pizza stack system, and i have ApplyActorAnimation like to grab the meal from that bar like from singleplayer. Yet whenever i step on the checkpoint and the actor is about to do the animation, my gta crashes. This works on other servers, but apparently not on mine. Something is missing.

Code:

ApplyActorAnimation(PizzaActor, "SHP_Tray_In", "SHP_Tray_Lift_Out", 4.1, 0, 0, 0, 0, 0); //I assume this is the animation, but im not sure.

[Ajuda] Certain Transfender cars

Pessoal, tô codando meu sistema de Tuning porém nos componentes em veículos compatíveis aparece "Certain transfender cars" Vocês poderiam me passar os IDs desses carros?

[Ajuda] /admins - Dialog

Bom dia.

Estou com um problema no meu /admins ele funciona perfeitamente, mas não do jeito que eu quero veja aqui esta a print dele funcionando normal.

print: https://imgur.com/a/QGsSlCN

Nessa print pra ele ta assim, foi usado este codigo

Codigo /admins dialog

PHP Code:

CMD:admins(playeridparams[])
{
    new 
count 1name[24], string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][pAdmin] != 0)
        {
            
GetPlayerName(inamesizeof(name));
            
format(stringsizeof(string), "%s%s: %s\n"stringnameCargo(i));
            
count ++;
        }
    }

    if(
count 0)
    {
        
ShowPlayerDialog(playerid123DIALOG_STYLE_MSGBOX"Membros da staff "string"OK""");
    }
    else 
ShowPlayerDialog(playerid123DIALOG_STYLE_MSGBOX"[!] Online Admins""No online admins""OK""");
    return 
1;


No entando nesse codigo acontece uma coisa, vc da /admins vc ve os admin online perfeitamente, só que quando não tem admins online, e vc da /admins era pra abrir a dialog dizendo que não tem nenhum admin online porem ela nem se quer abre, ou seja o /admins só funciona quando tem admin online.

mas eu queria q quando o jogador desse /admins ficasse assim

Print: https://imgur.com/a/fgl8W7J


eu tentei arrumar pra ficar tudo certinho mas falhei completamente rs, onde ta escrito "Admins" "Cargo" "Online"
era pra ficar cada coisa em seu lugar na reta de "Admins" os Admins, na reta de "Cargo" o cargo do admin e etc ... Mesmo tendo admin online n aparece na nova dialog com cargo admins etc ...

como posso resolver esses dois problemas?

Obs: Não sei se será util mais aqui esta.

PHP Code:

stock Cargo(playerid)
{
    new 
rankname[32];

    switch(
PlayerInfo[playerid][pAdmin])
    {
        case 
1: { rankname "{FFFF00}Ajudante"; }
        case 
2: { rankname "{FF8000}Moderador"; }
        case 
3: { rankname "{00FFFF}Administrador"; }
        case 
4: { rankname "{AF30CF}Sub-Dono(a)"; }
        case 
5: { rankname "{26F321}Staff"; }
    }

    return 
rankname;


Help save your skin custom when disconnect 03dl

I added the Custom skin to my server. The game works normally but when disconnected it returns to normal skin. I need help.

[Help] Function

Hello, i use the Southclaw Gamemode (Scavenge and Survive) and as I still do not have much experience with programming pawn, I would ask for help from you to build a function that verify if the player has such item in such amount in inventory, if anyone could help me would be very grateful.

Thanks in advance.

[Ajuda] Converter comando em ZCMD para Strcmp

Boa noite.
Alguém pode me ajudar a converter o comando abaixo para strcmp?

pawn Code:
CMD:cornick(playerid, params[]) {
    static hex;
    if(!sscanf(params, "x", hex)) {
        SetPlayerColor(playerid, hex);
    }
    return 1;
}

[Ajuda] Procurar dono do veículo

Quando eu procuro pelo dono do veículo, usando o /dl, aparece o dono de outro veículo
Como resolvo isso?

PHP Code:

Dialog:PlateID(playeridresponselistiteminputtext[])
{
    if (
GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid)))
        return 
0;

    if(
response)
    {
        new
            
id strval(inputtext);
            
        if(!
IsNumeric(inputtext))
            return 
Dialog_Show(playeridPlateIDDIALOG_STYLE_INPUT"Procurar Placa ((ID))""Para procurar pelo dono do veículo, você deve inserir o ID do veículo ((/dl))\n{FF6347}Insira o emplacamento do veículo abaixo.""Enviar""Voltar");

        if (!
IsValidVehicle(id))
            return 
SendErrorMessage(playerid"Você especificou uma placa inválida.");

        
Dialog_Show(playeridShowOnlyDIALOG_STYLE_MSGBOX"Resultado da Pesquisa""Modelo do Veículo: %s.\nDono do Veículo: %s.""Fechar"""ReturnVehicleName(id), CarData[id][carOwnerName]);
    }
    else 
cmd_mdc(playerid"\1");
    return 
1;


[Ajuda] Comando MSP

Olá, eu queria o comando /MSP para o meu servidor, eu sou novo nessa linguagem, e queria converter ele de strcmp para ZCMD... eu peguei ele da GM Bloody Vegas, se puder explicar como adaptar, seria ótimo. Obrigado.

Comando:
Code:

if(strcmp("/msp", cmdtext, true) == 0 || strcmp("/nascer", cmdtext, true) == 0) {
if(IsPlayerInAnyVehicle(playerid)) {return SendClientMessage(playerid, COLOUR_ERRO, "[ERRO]: Você deve sair de seu veículo.");}
if(CallRemoteFunction("LocalInvalidoParaSpawn","i",playerid) == 1) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: Proibido usar o /MSP ou /NASCER neste local");
if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid,COLOUR_ERRO,"[ERRO]: Você não pode nascer em interiores");
if(PlayerCustomSpawn[playerid] == 0){
GetPlayerPos(playerid, PlayerCustomSpawn_X[playerid], PlayerCustomSpawn_Y[playerid], PlayerCustomSpawn_Z[playerid]);
PlayerCustomSpawn_I[playerid] = GetPlayerInterior(playerid);
if(IsPlayerInAnyVehicle(playerid)){
GetVehicleZAngle(GetPlayerVehicleID(playerid),PlayerCustomSpawn_F[playerid]);
}else{GetPlayerFacingAngle(playerid, PlayerCustomSpawn_F[playerid]);}
PlayerCustomSpawn[playerid] = 1;
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você nascerá aqui, quando morrer");
}else{
PlayerCustomSpawn[playerid] = 0;
SendClientMessage(playerid, COLOUR_INFORMACAO, "[INFO]: Você nascerá aleatoriamente por Las Venturas");}
return 1;}

Tag Missmatch

HI!

Tag missmatch on the lines:

Code:

LastBack[0] = Px;
                        LastBack[1] = Py;
                        LastBack[2] = Pz;

Full code:

Code:

COMMAND:backup(playerid, params[])
{
        if(!isLEO(playerid))
        {
                Server(playerid, "Nu faci parte din politie.");
                return 1;
        }
        new msg[248], Float:Px, Float:Py, Float:Pz;
        if(inTied(playerid))
        {
                Server(playerid, "Nu poti folosi aceasta comanda pentru ca esti legat.");
                return 1;
        }
        foreach(new i : Player)
        {
                if(isLEO(i))
                {
                        GetPlayerPos(playerid, Px, Py, Pz);
                        LastBackup = playerid;
                        LastBack[0] = Px;
                        LastBack[1] = Py;
                        LastBack[2] = Pz;
                        format(msg, 248, "Politistul %s are nevoie de ajutor! Catre toate unitatile,pentru a raspune,foloseste /respond!", GetName(playerid));
                        SendClientMessage(i, COLOR_PURPLE, msg);
                }
        }
        return 1;
}

Viewing all 18226 articles
Browse latest View live


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