Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,496
» Latest member: u888brbrcom
» Forum threads: 2,412
» Forum posts: 12,359

Full Statistics

Online Users
There are currently 739 online users.
» 0 Member(s) | 735 Guest(s)
Bing, Applebot, Google, Yandex

Latest Threads
Adding new vehicles and s...
Forum: Programming
Last Post: __.A.__
Yesterday, 07:47 PM
» Replies: 0
» Views: 49
Zona América del Sur Free...
Forum: Advertisements
Last Post: kevinberriosflores
Yesterday, 02:16 PM
» Replies: 1
» Views: 71
Busco copia de gamemode S...
Forum: Spanish/Espa?ol
Last Post: briancristaldo2021
2025-09-11, 11:14 AM
» Replies: 0
» Views: 60
[Tutorial] Registrando o ...
Forum: Portuguese/Portugu?s
Last Post: Crazy_ArKzX
2025-09-09, 08:36 PM
» Replies: 0
» Views: 204
San Andreas Police Pursui...
Forum: Advertisements
Last Post: BriBri
2025-09-08, 10:09 PM
» Replies: 1
» Views: 293
Problem with plugins load...
Forum: Support
Last Post: MrKacu13
2025-09-08, 07:15 PM
» Replies: 9
» Views: 368
Compilation error
Forum: Pawn Scripting
Last Post: MrKacu13
2025-09-07, 07:18 AM
» Replies: 6
» Views: 353
Need help, problem when i...
Forum: Programming
Last Post: nonickowned
2025-09-06, 06:21 PM
» Replies: 0
» Views: 145
Transfer server from SAMP...
Forum: Support
Last Post: MrKacu13
2025-09-06, 04:03 PM
» Replies: 1
» Views: 238
Not relevant anymore
Forum: Questions and Suggestions
Last Post: peti
2025-09-05, 02:00 PM
» Replies: 0
» Views: 194

 
  Samp Voice Crashing the server
Posted by: robertjwx - 2021-07-10, 01:01 AM - Forum: Support - Replies (1)

Now with the samp voice plugin, a lot players is asking me to put this plugin to work in my server...
I put it to run in my server (running in a VPS), but it is crashing the server and closing everything...
Is anybody here had some problems like this?


server_log logs:

Code:
[13:43:34] [connection] incoming connection: PLAYER_IP:60365 id: 0
[13:44:22] [connection] incoming connection: PLAYER_IP:52750 id: 0
[13:44:29] [sv:dbg:network:connect] : connecting player (0) with address (PLAYER_IP) ...
[13:44:29] [sv:dbg:network:connect] : player (0) assigned key (f2b960b17e219403)
[13:44:29] [join] PLAYER_NAME has joined the server (0:PLAYER_IP)
[13:44:29] [sv:dbg:network:receive] : player (0) identified (port:60584)
[13:45:13] [sv:dbg:network:connect] : disconnecting player (0) ...
[13:45:13] [part] PLAYER_NAME has left the server (0:0)
[13:45:32] [connection] incoming connection: PLAYER_IP:49347 id: 0
[13:45:36] [sv:dbg:network:connect] : connecting player (0) with address (PLAYER_IP) ...
[13:45:36] [sv:dbg:network:connect] : player (0) assigned key (f2b960b1bd84cfcd)
[13:45:36] [join] PLAYER_NAME has joined the server (0:PLAYER_IP)
[13:45:37] [sv:dbg:network:receive] : player (0) identified (port:53049)
[13:46:07] [debug] Server crashed due to an unknown error
[13:46:07] [debug] Native backtrace:
[13:46:07] [debug] #0 f7344f7f in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () in plugins/crashdetect.so
[13:46:07] [debug] #1 f733d81d in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () in plugins/crashdetect.so
[13:46:07] [debug] #2 f733de48 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () in plugins/crashdetect.so
[13:46:07] [debug] #3 f733f5dc in _ZN11CrashDetect7OnCrashERKN2os7ContextE () in plugins/crashdetect.so
[13:46:07] [debug] #4 f734479f in ?? () in plugins/crashdetect.so
[13:46:07] [debug] #5 f7745cb0 in __kernel_rt_sigreturn () in linux-gate.so.1
[13:46:07] [debug] #6 0809621e in ?? () in ./samp03svr
[13:46:07] [debug] #7 f5c1372a in _ZN4Pawn34OnPlayerActivationKeyReleaseForAllEth () in plugins/sampvoice.so
[13:46:07] [debug] #8 c6f51400 in ?? ()
[13:46:07] [debug] Registers:
[13:46:07] [debug] EAX: 00000042 EBX: 39515816 ECX: 00000001 EDX: 09fe74b0
[13:46:07] [debug] ESI: 0a2eda80 EDI: 00000000 EBP: fff33fe8 ESP: fff33fe4
[13:46:07] [debug] EIP: 0809621e EFLAGS: 00010282
[13:46:07] [debug] Stack:
[13:46:07] [debug] ESP퍍㓓䴴: f5d29000 fff34018 f5c1372a 09fe74b0
[13:46:07] [debug] ESP퍍㓓䶴: f5ba451c 0a2edac0 00000042 f7755eeb
[13:46:07] [debug] ESP퍍㓓临: f775c5f0 f5c136bd f5d29000 fff34068
[13:46:07] [debug] ESP퍍㓓亴: 00000042 f5d29000 f5c19ab7 003d4ed5
[13:46:07] [debug] ESP퍍㓓伴: 0000a2b2 0b3bfba0 c6f51400 0977c1d0
[13:46:07] [debug] ESP퍍㓓䚴: 08159cf3 fff34098 080d1ce2 0979d488
[13:46:07] [debug] ESP퍍㓓䜴: 3bb04ab6 fff340c8 3bb04ab6 00000005
[13:46:07] [debug] ESP퍍㓓䞴: 2be6389d fff34208 080aa13a 0979d488
[13:46:07] [debug] ESP퍍㓓崴: 00000000 f77101d0 00000000 fff3410c
[13:46:07] [debug] ESP퍍㓓嶴: f775c5f0 f762138b 01003994 00010100
[13:46:07] [debug] ESP퍍㓓帴: 65646f6d f7003531 f7678910 f7711000
[13:46:07] [debug] ESP퍍㓓庴: f77121a0 08048b10 fff341b8 f776b000
[13:46:07] [debug] ESP퍍㓓弴: 00000000 00000000 00000000 00000000
[13:46:07] [debug] ESP퍍㓓嚴: 00000000 00000000 00000000 00000000
[13:46:07] [debug] ESP퍍㓓圴: 00000000 00000000 00000000 00000000
[13:46:07] [debug] ESP퍍㓓垴: 00000000 00000000 00000000 00000000
[13:46:07] [debug] ESP퍍㓓洴: 00000000 00000000 f739ea3b f75243dc
[13:46:07] [debug] ESP퍍㓓涴: f7524000 00000000 f7388286 00000001
[13:46:07] [debug] ESP퍍㓓渴: 00000000 f7524000 f776bc0c f776b000
[13:46:07] [debug] ESP퍍㓓溴: ba4d8b69 2dcd2778 00000000 00000000
[13:46:07] [debug] ESP퍍㓓漴: f775c5f0 f7388199 f776b000 00000001
[13:46:07] [debug] ESP퍍㓓暴: 00000001 fff342a4 08150650 08150640
[13:46:07] [debug] ESP퍍㓓朴: fff35e6e 00000000 fff35e7a fff35ead
[13:46:07] [debug] ESP퍍㓓枴: fff35efc fff35f1c fff35f2f fff35f43
[13:46:07] [debug] ESP퍍㓓紴: fff35f8f fff35fd1 fff35fdf 00000000
[13:46:07] [debug] ESP퍍㓓綴: 00000010 178bfbff 00000006 00001000
[13:46:07] [debug] ESP퍍㓓縴: 00000004 00000020 00000005 00000008
[13:46:07] [debug] ESP퍍㓓纴: 00000009 0804b4c0 0000000b 00000000
[13:46:07] [debug] ESP퍍㓓缴: 0000000e 00000000 00000017 00000000
[13:46:07] [debug] ESP퍍㓓皴: 0000000f fff343ab 00000000 00000000
[13:46:07] [debug] ESP퍍㓓眴: 901c7bff 6933cfe7 00363836 00000000
[13:46:07] [debug] ESP퍍㓓瞴: 00000000 00000000 00000000 00000000
[13:46:07] [debug] Loaded modules:
[13:46:07] [debug] 00000000 - 00187dc3 samp03svr
[13:46:07] [debug] f7745000 - f7745e2e linux-gate.so.1
[13:46:07] [debug] f7732000 - f77349c4 /lib/i386-linux-gnu/libdl.so.2
[13:46:07] [debug] f7715000 - f773075b /lib/i386-linux-gnu/libpthread.so.0
[13:46:07] [debug] f759b000 - f771ebbf /usr/lib/i386-linux-gnu/libstdc.so.6
[13:46:07] [debug] f7546000 - f759a120 /lib/i386-linux-gnu/libm.so.6
[13:46:07] [debug] f7528000 - f7544354 /lib/i386-linux-gnu/libgcc_s.so.1
[13:46:07] [debug] f7370000 - f752e73b /lib/i386-linux-gnu/libc.so.6
[13:46:07] [debug] f7747000 - f776b06c /lib/ld-linux.so.2
[13:46:07] [debug] f7325000 - f736d3d4 plugins/crashdetect.so
[13:46:07] [debug] f6f8f000 - f732a009 plugins/mysql.so
[13:46:07] [debug] f6f64000 - f6f8eb45 /root/sampserver/plugins/../log-core.so
[13:46:07] [debug] f6f5b000 - f6f6247c /lib/i386-linux-gnu/librt.so.1
[13:46:07] [debug] f5f46000 - f5f570d0 /lib/i386-linux-gnu/libnss_files.so.2
[13:46:07] [debug] f5f35000 - f5f449b4 plugins/sscanf.so
[13:46:07] [debug] f5d3a000 - f5dff740 plugins/streamer.so
[13:46:07] [debug] f5b8b000 - f5d444d5 plugins/sampvoice.so



samp voice code:
Code:
// samp voice 1
#include <sampvoice>

// / fim includes

// samp voice 2
new SV_GSTREAM:gstream = SV_NULL;
new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };

public SV_VOID:OnPlayerActivationKeyPress(SV_UINT:playerid, SV_UINT:keyid)
{
? ? // Attach player to local stream as speaker if 'B' key is pressed
? ? if (keyid == 0x42 && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid);
? ? // Attach the player to the global stream as a speaker if the 'Z' key is pressed
? ? if (keyid == 0x5A && gstream) SvAttachSpeakerToStream(gstream, playerid);
}

public SV_VOID:OnPlayerActivationKeyRelease(SV_UINT:playerid, SV_UINT:keyid)
{
? ? // Detach the player from the local stream if the 'B' key is released
? ? if (keyid == 0x42 && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid);
? ? // Detach the player from the global stream if the 'Z' key is released
? ? if (keyid == 0x5A && gstream) SvDetachSpeakerFromStream(gstream, playerid);
}

public OnPlayerConnect(playerid) {
Code:
// samp voice 3
    // Checking for plugin availability
    if (SvGetVersion(playerid) == SV_NULL)
    {
        SendClientMessage(playerid, -1, "Could not find plugin sampvoice.");
    }
    // Checking for a microphone
    else if (SvHasMicro(playerid) == SV_FALSE)
    {
        SendClientMessage(playerid, -1, "The microphone could not be found.");
    }
    // Create a local stream with an audibility distance of 40.0, an unlimited number of listeners
    // and the name 'Local' (the name 'Local' will be displayed in red in the players' speakerlist)
    else if ((lstream[playerid] = SvCreateDLStreamAtPlayer(40.0, SV_INFINITY, playerid, 0xff0000ff, "Local")))
    {
        SendClientMessage(playerid, -1, "Press Z to talk to global chat and B to talk to local chat.");

        // Attach the player to the global stream as a listener
        if (gstream) SvAttachListenerToStream(gstream, playerid);

        // Assign microphone activation keys to the player
        SvAddKey(playerid, 0x42);
        SvAddKey(playerid, 0x5A);
    }


public OnPlayerDisconnect(playerid, reason) {
Code:
? ? // samp voice 4
? ? // Removing the player's local stream after disconnecting
? ? if (lstream[playerid])
? ? {
? ? ? ? SvDeleteStream(lstream[playerid]);
? ? ? ? lstream[playerid] = SV_NULL;
? ? }

public OnGameModeInit() {

Code:
? ? // samp voice 5

? ? gstream = SvCreateGStream(0xffff0000, "Global");

public OnGameModeExit() {
Code:
? ? // samp voice 6

? ? if (gstream) SvDeleteStream(gstream);

from: https://github.com/CyberMor/sampvoice


  HELP! How to Get Status If The Vehicle go Flipped while destroyed?
Posted by: PutuSuhartawan - 2021-07-08, 11:03 AM - Forum: Pawn Scripting - Replies (4)

I saw a gamemode that supports anti-vehicle explode during a flip which is usually a scene of gasoline spilling and a fire burning. But here the purpose that will be discussed is the opposite. How can the vehicle flip itself back to its normal condition if the vehicle has really flipped and is about to explode?


  How to call a function an address?
Posted by: oukibt - 2021-07-06, 09:36 PM - Forum: Programming - Replies (1)

Hi I am trying to call a function at an address from a plugin but I am getting a crash.

Code:
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX* amx)
{
? ? VirtualUnlock((LPVOID)0x48B5B0, 0x20);

? ? ((int(__fastcall*)(char*))0x48B5B0)("query");
? ? return 1;
}

https://cdn.discordapp.com/attachments/5...nknown.png

I think, this is GetConsoleVariableInt function


  Need help
Posted by: misteryatt - 2021-07-06, 06:41 PM - Forum: Pawn Scripting - No Replies

Hello guys, i need PPC Housing filterscript. Did anyone here have it? I already googled and search on samp forums archive theres no working download link. thanks.



Ps: Idk which section to post this. Sorry if i post it in the wrong section.


  Help with command
Posted by: Pedxz - 2021-07-05, 05:31 PM - Forum: Pawn Scripting - Replies (1)

Welll, I update my command's permission to !IsPlayerAdmin, but now it doesn't want to work correctly, when i run the command it doesn't do anything.

***I changed the permission because the other one was having problems

Could you help me solve this??


Command:

Code:
CMD:setar(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Voc? n?o tem permiss?o!");

new id, sSetar[15];

if(sscanf(params, "ds[15]", id, sSetar)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Uso correto: /Setar [ ID ] [ Administrador / Moderador / Ajudante ]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERRO, "[ x ] Ningu?m online com esse ID!");

if(!strcmp(sSetar, "administrador", true))
{
if(GetPlayerCargo(id) != C_ADMIN)
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? tornou o(a) jogador(a) %s um(a) administrador(a).", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou voc? um(a) administrador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_ADMIN), aInfo[id][Cargo] = C_ADMIN;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? removeu os privil?gios de administrador(a) do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privil?gios de administrador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
else if(!strcmp(sSetar, "moderador", true))
{
if(GetPlayerCargo(playerid) != C_MODERADOR)
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? tornou o(a) jogador(a) %s um(a) moderador(a).", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou voc? um(a) moderador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_MODERADOR), aInfo[id][Cargo] = C_MODERADOR;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? removeu os privil?gios de moderador(a) do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privil?gios de moderador(a).", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
else if(!strcmp(sSetar, "ajudante", true))
{
if(GetPlayerCargo(playerid) != C_AJUDANTE)
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? tornou o(a) jogador(a) %s um(a) ajudante.", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s tornou voc? um(a) ajudante.", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_AJUDANTE), aInfo[id][Cargo] = C_AJUDANTE;
}
else
{
format(gStr, sizeof(gStr), "[BPL Staff] Voc? removeu os privil?gios de ajudante do(a) jogador(a) %s", pNome(id));
SendClientMessage(playerid, COLOR_VERDECMD, gStr);

format(gStr, sizeof(gStr), "[BPL Staff] %s removeu seus privil?gios de ajudante.", GetCargoMsg(playerid));
SendClientMessage(id, COLOR_VERDECMD, gStr);

SetPVarInt(id, "pCargo", C_JOGADOR), aInfo[id][Cargo] = C_JOGADOR;
}
}
return 1;
}


  looking for free dev
Posted by: gerald - 2021-07-05, 02:11 PM - Forum: Support - No Replies

i have CCRP v3.2 script i need a dev to remove the tutorial.

my discord is realpimp#4630


  Pathfinder With CA
Posted by: Axivv - 2021-07-05, 06:47 AM - Forum: Pawn Scripting - Replies (2)

I found a include (https://raw.githubusercontent.com/dimmyi...finder.inc) but there is a warning: "This is an experimental pathfinder made for SA-MP totally in pawn, the same is still not recommended for use." How can I more optimize it?


  How to decrease SetPlayerWantedLevel every 5 seconds?
Posted by: XDK6 - 2021-07-04, 07:13 AM - Forum: Pawn Scripting - Replies (6)

Hi guys I need help how to decrease setplayerwanted levels for every 5 second


Question How to convert string to int?
Posted by: ViktorNas - 2021-07-04, 02:10 AM - Forum: Pawn Scripting - Replies (4)

Please tell me if there is any function that does this or how I could make a function that does this.


  How can I do an ini save for this tuning system using AttachObjectToVehicle?
Posted by: Paco_Martez - 2021-07-01, 08:25 PM - Forum: Pawn Scripting - No Replies

Hi, I don't know how to speak English very well, I'm from Argentina but ..., How can I save an .ini for this tuning system using AttachObjectToVehicle?







#include <a_samp>



#include <zcmd>



#include <sscanf2>



#include <streamer>



#include <mSelection>



#include <YSI\y_ini>











#define DRAWDISTANCE_DEFAULT 80



#define SPEEDMULTIPLIER_HIGH? ? ? ? 0.20



#define SPEEDMULTIPLIER_LOW? ? ? ? 0.01











#define MODE_NONE? ? ? ? ? 0



#define MODE_PX 1



#define MODE_PY? ? 2



#define MODE_PZ? ? ? ? ? ? 3



#define MODE_RX? ? ? ? ? ? 4



#define MODE_RY? ? ? ? ? ? 5



#define MODE_RZ? ? ? ? ? ? 6



#define MAX_OBJVEH? ? ? ? ? 7







//Defines



#define PlayerToPoint(%1,%2,%3,%4,%5)? IsPlayerInRangeOfPoint(%2,%1,%3,%4,%5)



#define? ? ? ? ? ? Message ? ? ? ? ? ? ? ? ? ? ? ? ? ? SendClientMessage



#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessageEx(%0,%1,_str);}while(FALSE)



#define GivePlayerCash GivePlayerMoney



//Colores



#define Blanco 5883



#define iCOL_RED? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0xFF0000FF



//Dialogo



//Textdraws







// News



//Catalogo



new objetostu = mS_INVALID_LISTID;



//Taller



#define TG_FILE "Talleres/%d.ini"



#define TG_OBJ? ? ? ? "Objetos/%d.ini"







#define MAX_TUNE? ? ? 5000



#define MAX_GARAGES? 5000







//Dialogos



#define DIALOG_TUNING_TALLER 8431 //Ids para evitar bugs :s



//Enums











enum Attaching



{



Temp,



bool:Saved,



Timer,



bool:Enabled,



Mode,



ModelID,



ObjectID,



VehicleID,



Float:P[3],



Float:R[3],



d_ObjIdInput



};



new Attach[MAX_PLAYERS][Attaching];







enum aaa {



Float:Position[ 3 ],



? ? Text3D:tg3D,



? ? tgPickup,



}















new Talleres[ MAX_GARAGES ][ aaa ];







//Stocks







public OnFilterScriptInit()



{







objetostu = LoadModelSelectionMenu("objetostu.txt");







? for(new i = 1; i < MAX_GARAGES; i) {



? ? new file[ 50 ];



? ? format( file, sizeof( file ), TG_FILE, i );



? ? if( fexist( file ) ) {



? ? INI_ParseFile( file, "LoadTalleres", .bExtra = true, .extra = i );



? ? ? ? Talleres[ i ][ tg3D ] = Create3DTextLabel( "Usa {b9f442}/tuning {FFFFFF}para tunear tu veh?culo", -1, Talleres[ i ][ Position ][ 0 ], Talleres[ i ][ Position ][ 1 ], Talleres[ i ][ Position ][ 2 ], 15.0, 0, 1 );



Talleres[ i ][ tgPickup ] = CreatePickup( 1239, 1, Talleres[ i ][ Position ][ 0 ], Talleres[ i ][ Position ][ 1 ], Talleres[ i ][ Position ][ 2 ], -1 );



}



}



return 1; //se retorna a 1.



}











public OnFilterScriptExit()



{



for(new i=0; i<MAX_PLAYERS; i) { KillTimer(Attach[i][Timer]); }



print("\n? :C\n");







return 1;



}











public OnPlayerSpawn(playerid)



{











return 1;



}















public OnPlayerConnect(playerid)



{







? ? Attach[playerid][Saved] = true;



return true;







}







public OnPlayerModelSelection(playerid, response, listid, modelid)



{



if(listid == objetostu)



{



if(response)



{



? ? ? ? ? Atta(playerid, modelid);



GivePlayerMoney(playerid, -5000); //dinero



SendClientMessage(playerid, 0xFFFFFFFF, "Compraste un objeto para tu veh?culo.");



}



else SendClientMessage(playerid, 0xFFFFFFFF, "Has salido del catalogo de objetos.");



}



return 1;



}















public OnPlayerDisconnect(playerid, reason)



{



KillTimer(Attach[playerid][Timer]);



Attach[playerid][Mode] = MODE_NONE;



? ? Attach[playerid][Temp] = 0;



? ? Attach[playerid][ModelID] = 0;



? ? Attach[playerid][ObjectID] = 0;



? ? Attach[playerid][VehicleID] = 0;



? ? Attach[playerid][Enabled] = false;



? ? for(new i=0; i<3; i) { Attach[playerid][P][i] = 0.0; Attach[playerid][R][i] = 0.0;}



return true;



}







CMD:creditostuning(playerid, params[])



{



SendClientMessage(playerid, -1, "Sistema Creador Por Franco Londes, Franco12 en pawnscript.");



return 1;



}







CMD:creartaller( playerid, params[] ) {



? ? if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid,-1,? "Debes estar logeado con rcon." );



? ? new i = NextIDGarage( MAX_GARAGES ), Float:Pos[ 3 ], file[ 40 ];



GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );



format( file, sizeof( file ), TG_FILE, i );



if( fexist( file ) ) return SendClientMessage( playerid,-1, "Esta ID ya existe." );



Talleres[ i ][ Position ][ 0 ] = Pos[ 0 ];



Talleres[ i ][ Position ][ 1 ] = Pos[ 1 ];



Talleres[ i ][ Position ][ 2 ] = Pos[ 2 ];



Talleres[ i ][ tg3D ] = Create3DTextLabel( "Usa {b9f442}/tuning {FFFFFF}para tunear tu veh?culo", -1, Talleres[ i ][ Position ][ 0 ], Talleres[ i ][ Position ][ 1 ], Talleres[ i ][ Position ][ 2 ], 15.0, 0, 1 );



Talleres[ i ][ tgPickup ] = CreatePickup( 1239, 1, Talleres[ i ][ Position ][ 0 ], Talleres[ i ][ Position ][ 1 ], Talleres[ i ][ Position ][ 2 ], -1 );



SaveTalleres( i );



return true;



}



//==============================================================================



CMD:eliminartaller( playerid, params[] ) {



? ? if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "Debes estar logeado con rcon." );



new i = GetNearestTalleres( playerid );



if( i == -1 ) return SendClientMessage( playerid, -1,? "No est?s en el taller (pickup)." );







Talleres[ i ][ Position ][ 0 ] = 0.0;



Talleres[ i ][ Position ][ 1 ] = 0.0;



Talleres[ i ][ Position ][ 2 ] = 0.0;







DestroyPickup( Talleres[ i ][ tgPickup ] );



Delete3DTextLabel( Talleres[ i ][ tg3D ] );







? ? new file[ 50 ];



format( file, sizeof( file ), TG_FILE, i );



if( fexist( file ) ) { fremove( file ); }







SendClientMessage( playerid, -1, "Taller eliminado." );



return true;



}











CMD:tuning(playerid, params[])



{



if( GetNearestTalleres( playerid ) == -1 ) return SendClientMessage( playerid, -1, "No est?s en el taller de tuning." );



if( !IsPlayerInAnyVehicle(playerid) ) return SendClientMessage(playerid, 0xFF0000FF, "No est?s en un veh?culo.");



ShowPlayerDialog(playerid, DIALOG_TUNING_TALLER, DIALOG_STYLE_LIST, "Menu Tuning", "Comprar Objeto\nEditar Posici?n de Objeto\nRemover Objeto", "Seleccionar", "Cancelar");



return 1;



}







CMD:4532434343(playerid, params[])



{



? ? if( !Attach[playerid][Saved] ) {



? ? ShowModelSelectionMenu(playerid, objetostu, "Venta de Objetos");



return true;



}



new modelid;



Atta(playerid, modelid);



return true;



}



?



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])



{



if(response)// Si se pulsa el primer bot?n.



{



switch(dialogid)// Si s?lo tiene un cuadro de di?logo, entonces esto no es necesario, pero es m?s Organizado para cuando se implementan m?s cuadros de di?logo.



{



case DIALOG_TUNING_TALLER:// Nuestro dialogo



? ? ? ? {



? ? ? ? ? switch(listitem)// Comprueba Si a Sido Seleccionado



? ? ? ? {



? ? ? ? ? ? case 0:// El Primer Boton Incluido



? ? ? ? ? ? {



? ? ? ? ? ? ? ? ? ? ShowModelSelectionMenu(playerid, objetostu, "Venta de Objetos");



? ? ? ? ? ? }



? ? ? ? ? ? case 1: // Esto es el segundo boton



? ? ? ? ? ? {



SendClientMessage(playerid, -1, "Usa /ayudatuning para editar la posici?n del objeto, /terminartuning para acabar");



? ? ? ? ? ? }



? ? ? ? ? ? case 2: // El Tercer boton



? ? ? ? ? ? {



SendClientMessage(playerid, -1, "Has eliminado el objeto");



DestroyObject(Attach[playerid][ObjectID]);



? ? ? ? ? ? }



? ? ? ? }



? ? ? ? }



}



? ? }



return 1;



}



//=========================================================================================================================================================







//=====================================================================================================================================================



GetNearestTalleres( playerid ) {



? ? for(new i = 1; i < MAX_GARAGES; i) {



? ? ? ? if( IsPlayerInRangeOfPoint( playerid, 10.0, Talleres[ i ][ Position ][ 0 ], Talleres[ i ][? Position ][ 1 ], Talleres[ i ][ Position ][ 2 ] ) ) { return i; }



}



return -1;



}



//========================================================================================================================================================



stock NextIDGarage(const len) {



? ? new id = (-1);



? ? for( new loop = ( 0 ), provjera = ( -1 ), Data_[ 64 ] = "\0"; loop != len; loop ) {



? ? ? provjera = ( loop );



? ? ? format( Data_, ( sizeof Data_ ), TG_FILE, provjera );



? ? ? if(!fexist(Data_)) {



? ? ? ? ? id = ( provjera );



? ? ? ? ? break; } }



? return ( id );



}



//==============================================================================



forward SaveTalleres( id );



public SaveTalleres( id ) {



new iFile[ 40 ];



? ? format( iFile, sizeof( iFile ), TG_FILE, id );



new INI:File = INI_Open( iFile );



INI_WriteFloat( File, "Position1", Talleres[ id ][ Position ][ 0 ] );



INI_WriteFloat( File, "Position2", Talleres[ id ][ Position ][ 1 ] );



INI_WriteFloat( File, "Position3", Talleres[ id ][ Position ][ 2 ] );



INI_Close( File );



return 1;



}



//==============================================================================



forward LoadTalleres( id, name[], value[] );



public LoadTalleres( id, name[], value[] ) {



INI_Float( "Position1", Talleres[ id ][ Position ][ 0 ] );



INI_Float( "Position2", Talleres[ id ][ Position ][ 1 ] );



INI_Float( "Position3", Talleres[ id ][ Position ][ 2 ] );



? ? return true;



}



//==============================================================================



forward Atta(playerid, modelid);



//==============================================================







public Atta(playerid, modelid)



{



? ? Attach[playerid][Timer] = SetTimerEx("OnPlayerUpdateEx", 50, true, "d", playerid);



? ?



? ? //==================================================================================







? ? Attach[playerid][Mode] = MODE_NONE;



? ? Attach[playerid][Temp] = 0;



? ? Attach[playerid][VehicleID] = 0;



? ? for(new i=0; i<3; i) { Attach[playerid][P][i] = 0.0; Attach[playerid][R][i] = 0.0;}



? ?



? ? //======================================================================================







? ? Attach[playerid][Enabled] = true;



Attach[playerid][ModelID] = modelid;



Attach[playerid][ObjectID] = CreateObject(Attach[playerid][ModelID], 0, 0, -1000, 0, 0, 0, DRAWDISTANCE_DEFAULT);



Attach[playerid][VehicleID] = GetPlayerVehicleID(playerid);



AttachObjectToVehicle(Attach[playerid][ObjectID], Attach[playerid][VehicleID], 0, 0, 0, 0, 0, 0);



? ? EditDynamicObject(playerid, ObjectID);



Attach[playerid][Saved] = false;



return true;



}







CMD:ayudatuning(playerid, params[])



{



SendClientMessage(playerid, -1, "Usa /posx, /posy, /posz, para cambiar la posici?n del objeto.");



SendClientMessage(playerid, -1, "Usa /rotx, /roty, /rotz, para cambiar la rotaci?n del objeto. /terminartuning para terminar.");



return 1;



}







CMD:posx(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_PX; SendClientMessage(playerid, -1, "[X]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:posy(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_PY; SendClientMessage(playerid, -1, "[Y]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:posz(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_PZ; SendClientMessage(playerid, -1, "[Z]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:rotx(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_RX; SendClientMessage(playerid, -1, "[RX]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:roty(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_RY; SendClientMessage(playerid, -1, "[RY]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:rotz(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_RZ; SendClientMessage(playerid, -1, "[RZ]Bien, usa las teclas Izquierda/Derecha para editar, /terminartuning para acabar."); }



return true;



}



CMD:terminartuning(playerid, params[])



{



? ? if(!Attach[playerid][Enabled]) { SendClientMessage(playerid, 0xFF0000FF, "?No est?s en el taller de tuning!."); }



? ? else { Attach[playerid][Mode] = MODE_NONE; SendClientMessage(playerid, 0xFF00FFFF, "Tuning Finalizado."); KillTimer(Attach[playerid][Timer]); }



? ? return true;



}















forward OnPlayerUpdateEx(playerid);



public OnPlayerUpdateEx(playerid)



{



if(Attach[playerid][Mode] == MODE_NONE) return true;







? ? new KEYS, UD, LR; GetPlayerKeys( playerid, KEYS, UD, LR );







new Float:SPDM = 0.1;







if(KEYS == 128) { SPDM = SPEEDMULTIPLIER_HIGH; }



else if (KEYS == 4) { SPDM = SPEEDMULTIPLIER_LOW; }







? ? if(LR > 0) { UpdateVObject(playerid, SPDM); }



else if(LR < 0) { UpdateVObject(playerid, -SPDM); }



? ? return 1;



}











forward UpdateVObject(playerid, Float:value);



public UpdateVObject(playerid, Float:value)



{



DestroyObject(Attach[playerid][ObjectID]);



Attach[playerid][ObjectID] = CreateObject(Attach[playerid][ModelID], 0, 0, 6, 0, 0, 0, DRAWDISTANCE_DEFAULT);







switch(Attach[playerid][Mode])



{



? ? case MODE_PX: {



? ? ? ? Attach[playerid][P][0] = value;



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Posicion [X]",Attach[playerid][P][0]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



case MODE_PY: {



? ? Attach[playerid][P][1] = value;



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Posicion [Y]",Attach[playerid][P][1]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



case MODE_PZ: {



? ? Attach[playerid][P][2] = value;



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Posicion [Z]",Attach[playerid][P][1]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



case MODE_RX: {



? ? ? ? if(Attach[playerid][R][0] value*10 <= 360.0 && Attach[playerid][R][0] value*10 >= 0.0) { Attach[playerid][R][0] = value*10; }



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Rotacion [X]",Attach[playerid][P][0]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



case MODE_RY: {



? ? if(Attach[playerid][R][1] value*10 <= 360.0 && Attach[playerid][R][1] value*10 >= 0.0) { Attach[playerid][R][1] = value*10; }



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Rotacion [Y]",Attach[playerid][R][1]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



case MODE_RZ: {



? ? if(Attach[playerid][R][2] value*10 <= 360.0 && Attach[playerid][R][2] value*10 >= 0.0) { Attach[playerid][R][2] = value*10; }



? ? ? ? new string[64];



? ? ? ? format(string, sizeof(string), "Editando Rotacion [Z]",Attach[playerid][R][2]);



? ? ? ? GameTextForPlayer(playerid, string, 10000, 3);



}



}



AttachObjectToVehicle(Attach[playerid][ObjectID], Attach[playerid][VehicleID], Attach[playerid][P][0], Attach[playerid][P][1], Attach[playerid][P][2], Attach[playerid][R][0], Attach[playerid][R][1], Attach[playerid][R][2]);



return true;



}