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

Help, command unban player!

$
0
0
Hello friends! Today I have a serious problem! I made a system to unban players from my server, and I'm trying the following problem.. When I type the command "/unban" to unban a banned account from the server, from this following message!

"This account is not banned."

Code:

CMD:unban(playerid, params[])
{
    if(!Data[playerid][Connect])
                return SendError(playerid, "You are not logged in to the server!");

    if(sscanf(params, "s[24]s[16]", params[0], params[1]))
        return SendSyntaxMessage(playerid, "/unban (NICK) And (IP)");

    if(!DOF2_FileExists(GetBanFile(params[0])))
        return SendError(playerid, "This account is not banned.");

    DOF2_RemoveFile(GetBanFile(params[0]));
        SendWarnning(playerid, "Account successfully removed from the list of bans.");

    if(!DOF2_FileExists(GetIPBanFile(params[1])))
        return SendError(playerid, "This IP is not banned.");

    DOF2_RemoveFile(GetIPBanFile(params[1]));
        SendWarnning(playerid, "Account IP has been successfully removed.");

    return true;
}

I no longer know what is causing this .. Because there really is a banned account!
Print: https://prnt.sc/p1hsvt

Need a Little help

$
0
0
[debug] #1 005e68b0 in public ServerHeartbeatTwo@_yT (p=0) at C:\Users\Administrator\Desktop\New Life Roleplay 2019\gamemodes\NLRP.pwn:127615

Code

Code:

ptask ServerHeartbeatTwo[1000](playerid)
{
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new myweapons[13][2];
        //new szMessage[128];
        if(GetPVarInt(playerid, "IsInArena") == -1)
        {
                for (new i = 0; i < 13; i++)
                {
                        GetPlayerWeaponData(playerid, i, myweapons[i][0], myweapons[i][1]);
                        if(PlayerInfo[playerid][pGuns][i] == myweapons[i][0])
                        {
                            PlayerInfo[playerid][pGunAmmo][i] = myweapons[i][1];
                                  //format(szMessage, sizeof(szMessage), "* %s has ran out of ammo.", GetPlayerNameEx(playerid));//ran out of ammo check
                          // ProxDetector(25.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                }
        }
        if(GetPVarInt(playerid, "IsOnFire") && !CanPlayerBurn(playerid, 1))
        {
                TogglePlayerBurning(playerid, false);
        }
        if(CanPlayerBurn(playerid) && IsAtFire(playerid))
                {
                        TogglePlayerBurning(playerid, true);
                }
                #if defined BurnOthers
                new Float:x, Float:y, Float:z;
                for(new i; i < MAX_PLAYERS; i++)
                  {
                      if(playerid != i && IsPlayerConnected(i) && !IsPlayerNPC(i))
                          {
                                  if(CanPlayerBurn(i) && GetPVarInt(playerid, "IsOnFire") && !GetPVarInt(i, "IsOnFire"))
                              {
                                          GetPlayerPos(i, x, y, z);
                                        if(IsPlayerInRangeOfPoint(playerid, BURNING_RADIUS, x, y, z))
                                        {
                                            TogglePlayerBurning(i, true);
                                        }
                                }
                        }
                }
                #endif
        if(IsPlayerInAnyVehicle(playerid)) {
                SetPlayerArmedWeapon(playerid, 0);
        }
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && JetPack[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 4)
        {
                new string[74 + MAX_PLAYER_NAME];
            format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) possibly just loaded s0biet and gave himself a fucking jetpack...Faggot", GetPlayerNameEx(playerid), playerid);
                ABroadCast( COLOR_YELLOW, string, 2 );
                format(string, sizeof(string), "%s (ID %d) may possibly be jetpack hacking.", GetPlayerNameEx(playerid), playerid);
                Log("logs/hack.log", string);
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) for(new h = 0; h < sizeof(FamilyInfo); h++)
        {
                if(IsPlayerInRangeOfPoint(playerid, 2.0, FamilyInfo[h][FamilySafe][0], FamilyInfo[h][FamilySafe][1], FamilyInfo[h][FamilySafe][2]))
                {
                        if(FamilyInfo[h][FamilyUSafe] == 1)
                        {
                                GameTextForPlayer(playerid, "~y~gang safe~w~~n~Type ~r~/safehelp~w~ for more information", 5000, 3);
                        }
                }
        }
        if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0, -1608.8733,1284.3466,7.1777) || IsPlayerInRangeOfPoint(playerid,2.0, 2101.7676,-1885.9995,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0, 534.2360,913.0679,-42.9609))
        {
                if(PlayerInfo[playerid][pJob] == 24)
                {
                        new string[128];
                    format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can restock in San Fierro", matssys[MatsAmmount]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
                else if(PlayerInfo[playerid][pJob] != 24)
                {
                        new string[128];
                    format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d", matssys[MatsAmmount]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
                else if(PlayerInfo[playerid][pJob] == 9)
                {
                        new string[128];
                    format(string, sizeof(string), "~y~Materials Bank~n~Materials storage: ~r~%d ~n~~w~You can ~g~/getmats ~w~in Los Angeles", matssys[MatsAmmount]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
        }
        if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0,325.6044,1123.5282,1083.8828))
        {
                if(PlayerInfo[playerid][pJob] == 14)
                {
                        new string[128];
                    format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
                        GameTextForPlayer(playerid, string, 5000, 3);
                }
                else if(PlayerInfo[playerid][pJob] == 4)
                {
                        new string[128];
                        format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d~n~~w~You can /getpot && /getcrack here", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
                        GameTextForPlayer(playerid, string, 5000, 3);
                }
                else
                {
                        new string[128];
                    format(string, sizeof(string), "~y~Drug House (Pot): %d~n~~y~Drug House (Crack): %d", drugsys[DrugPotAmmount], drugsys[DrugCrackAmmount]);
                        GameTextForPlayer(playerid, string, 5000, 3);
                }
        }
        if(GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,2.0,-51.4929,1398.0430,1084.4297))
        {
                new string[128];
                format(string, sizeof(string), "~y~Type ~r~/cookheroin~n~~y~to begin cooking your heroin!");
                GameTextForPlayer(playerid, string, 5000, 3);
        }
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(playerid,2.0,-1584.3499,-2718.8491,48.5391))
        {
                new string[128];
                format(string, sizeof(string), "~y~Type ~r~/opengarage ~y~to enter the garage.");
                GameTextForPlayer(playerid, string, 5000, 3);
        }
        for(new h = 0; h < sizeof(Points); h++)
        {
                if(IsPlayerInRangeOfPoint(playerid, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz]))
                {
                        if(Points[h][Type] == 1 && GetPVarInt(playerid, "Packages") == 0)
                        {
                                GameTextForPlayer(playerid, "~w~Type /getmats to purchase a ~n~~r~materials package", 5000, 5);
                        }
                        else if(Points[h][Type] == 3 && PlayerInfo[playerid][pPot] < 3)
                        {
                                GameTextForPlayer(playerid, "~w~Type /getseeds to purchase some ~r~pot seeds", 5000, 5);
                        }
                }
        }
        if(SafeTime[playerid] > 0) {
                if(--SafeTime[playerid] == 1 && gPlayerAccount[playerid] == 1 && gPlayerLogged{playerid} == 0) {
                        SendClientMessageEx(playerid, COLOR_WHITE, "HINT: You can now login by typing your password below.");
                }
        }
        if(PlayerInfo[playerid][pLocal] != 255 && PlayerInfo[playerid][pInt] != 0)
        {
                new house = PlayerInfo[playerid][pLocal];
                GetPlayerPos(playerid, oldposx, oldposy, oldposz);
                if(oldposz != 0.0)
                {
                        if(oldposz < 600.0)
                        {
                                if(house == 242)
                                {
                                        SetPlayerInterior(playerid,0);
                                        SetPlayerPos(playerid,1073.0619,-344.5148,73.9922);
                                        PlayerInfo[playerid][pInt] = 0;
                                        PlayerInfo[playerid][pLocal] = 255;
                                }
                        }
                }
        }
        if(CellTime[playerid] > 0)
        {
                if (CellTime[playerid] == cchargetime)
                {
                        CellTime[playerid] = 1;
                        if(Mobile[Mobile[playerid]] == playerid)
                        {
                                CallCost[playerid] += callcost;
                        }
                }
                CellTime[playerid]++;
                if (Mobile[Mobile[playerid]] == INVALID_PLAYER_ID && CellTime[playerid] == 5)
                {
                        if(IsPlayerConnected(Mobile[playerid]))
                        {
                            new Float:rX, Float:rY, Float:rZ;
                            GetPlayerPos(playerid, rX, rY, rZ);
                                new string[18 + MAX_PLAYER_NAME];
                                format(string, sizeof(string), "* %s's phone rings.", GetPlayerNameEx(Mobile[playerid]));
                                RingTone[Mobile[playerid]] = 10;
                                ProxDetector(30.0, Mobile[playerid], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        }
                }
        }
        if(CellTime[playerid] == 0 && CallCost[playerid] > 0)
        {
                new string[28];
                format(string, sizeof(string), "~w~The call cost~n~~r~$%d",CallCost[playerid]);
                GivePlayerCash(playerid, -CallCost[playerid]);
                GameTextForPlayer(playerid, string, 5000, 1);
                CallCost[playerid] = 0;
        }
        if(TransportDriver[playerid] < 999)
        {
                if(GetPlayerVehicleID(playerid) != GetPlayerVehicleID(TransportDriver[playerid]) || !TransportDuty[TransportDriver[playerid]])
                {
                        if(IsPlayerConnected(TransportDriver[playerid]))
                        {
                                TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                                TransportTime[TransportDriver[playerid]] = 0;
                                TransportCost[TransportDriver[playerid]] = 0;
                                new string[36];
                                format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
                                GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
                                TransportDriver[playerid] = 999;
                        }
                }
                else if(TransportTime[playerid] >= 16)
                {
                        TransportTime[playerid] = 1;
                        if(TransportDriver[playerid] < 999)
                        {
                                if(IsPlayerConnected(TransportDriver[playerid]))
                                {
                                          TransportCost[playerid] += TransportValue[TransportDriver[playerid]];
                                        TransportCost[TransportDriver[playerid]] = TransportCost[playerid];
                                }
                        }
                }
                TransportTime[playerid] += 1;
                new string[24];
                format(string, sizeof(string), "~r~%d ~w~: ~g~$%d",TransportTime[playerid],TransportCost[playerid]);
                GameTextForPlayer(playerid, string, 15000, 6);
                if(TransportCost[playerid] > GetPlayerCash(playerid))
                {
                    //RemovePlayerFromVehicle(playerid);
                    new Float:slx, Float:sly, Float:slz;
                        GetPlayerPos(playerid, slx, sly, slz);
                        SetPlayerPos(playerid, slx, sly, slz + 2);
                    GameTextForPlayer(playerid, "~r~You're flat out of cash!", 4000, 4);
                }
        }
        if(GetPVarInt(playerid, "rccam") == 0)
        {
                if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 594)
                {
                        DestroyVehicle(GetPVarInt(playerid, "rcveh"));
                    KillTimer(GetPVarInt(playerid, "rccamtimer"));
                }
        }
}

Inactivity of the forum.

$
0
0
It may seem to me, but I have a feeling that fewer people are visiting or writing something in the forum. I also expected that over the summer it would be more active, but it didn't. Is there a reason for concern, or is this just a consequence of Kalcor's banning developers who were active ?

Y_ini not load data

$
0
0
Every i relog, data reset to 0
before :
Code:

Admin level = 1
Cash = 10000
Ban = 1

after:
Code:

Admin level = 0
Cash = 0
Ban = 0


Code:

#include <a_samp>
#include <YSI\y_ini>

#define RED 0xFF0000FF
#define DARKRED 0x800000FF
#define BLUE 0x0000FFFF
#define DARKBLUE 0x0000A0FF
#define GREEN 0x00FF00FF
#define DARKGREEN 0x008000FF
#define YELLOW 0xFFFF00FF
#define WHITE 0xFFFFFFFF
#define BLACK 0x000000FF

#define path "/users/%s.ini"

enum PlayerInfo
{
        pAdmin,
        pCash,
        pBan
}
new ii[MAX_PLAYERS][PlayerInfo];
forward LoadUser_Data(playerid, name[], value[]);
public LoadUser_Data(playerid, name[], value[])
{
        INI_Int("Admin Level", ii[playerid][pAdmin]);
        INI_Int("Cash", ii[playerid][pCash]);
        INI_Int("Ban", ii[playerid][pBan]);
        return 1;
}

stock uPath(playerid)
{
        new str[128], PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        format(str, sizeof(str), path, PlayerName);
        return str;
}
public OnPlayerConnect(playerid)
{
        if(fexist(uPath(playerid)))
        {
                if(ii[playerid][pBan] == 0 )
                {
                        INI_ParseFile(uPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                }
                else
                {
                        SendClientMessage(playerid, DARKRED, "Account have banned from server!");
                        return 0;
                }
        }
        else
        {
                SendClientMessage(playerid, DARKGREEN , "Tai khoan chua duoc dang ky , dang tien hanh dang ky tai khoan!");
                new INI:File = INI_Open(uPath(playerid));
                INI_WriteInt(File, "Admin Level", 0);
                INI_WriteInt(File, "Cash" , 0);
                INI_WriteInt(File, "Ban", 0);
                INI_Close(File);
        }
        return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
        new INI:File = INI_Open(uPath(playerid));
        INI_WriteInt(File, "Admin Level", ii[playerid][pAdmin]);
        INI_WriteInt(File, "Cash" , GetPlayerMoney(playerid));
        INI_WriteInt(File, "Ban", ii[playerid][pBan]);
        INI_Close(File);
        return 1;
}

public OnPlayerSpawn(playerid)
{
        GivePlayerMoney(playerid, ii[playerid][pCash]);
        return 1;
}

Map Andreas question

$
0
0
Ok so, i'm using 3DTryg and MapAndreas and made this:

pawn Code:
new Float:x, Float:y, Float:z;

GetRandomPointInRectangle(-3000.0, -3000.0, 3000.0, 3000.0, x, y);

while(IsPointInWater(x, y, 0.0)) GetRandomPointInRectangle(-3000.0, -3000.0, 3000.0, 3000.0, x, y);

Tryg3D_MapAndreasFindZ(x,y, z);

new object = CreateDynamicObject(19341, x, y, z+0.55, 0.0, 0.0, 0.0, 0,0, -1, 50.0);

To create object ID 19341 to a random map on whole SA.

I've also tried avoid the creation in water, so my question is, is this code correct? And can someone give me an optimization tip?

Thanks.

Bullworth Roleplay [Heavy Roleplay, 450+ Discord members, 2K+ Video Clicks]

[Map] Palomino Creek - Sheriff

$
0
0
Hello Dear Forum Members.
Me with my friend Polygon making one of roleplay type server in red county of hobby, he's the script maker and im the member who try making design for this server.
I wanted to ask for rating my job, specifically sheriff department. It's fully created in 3DS Max, just one or two object is created in map editor.
Here's it. :)
Some of pictures




If u need a mapper, model maker or simply designer, send my a message and we can to make a deal. :)

Move Player Camera


Drop an object a little in front

$
0
0
How to drop an object a little in front?

I found this funcion on forum:
Code:

stock GetXYFront(&Float:x, &Float:y, Float:a, Float:distance)
{
    x += distance * floatsin(-a, degrees);
    y += distance * floatcos(-a, degrees);
}

But idk how to use...

I need to if enter on this condition:
Code:

    if(onHands == true) {
        GetXYFront(CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseR], 1.0)
        CadaverObject[cid] = CreateObject(2907, CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseZ]-1, CadaverInfo[cid][corpseR], 0.0, 0.0);;
    }

drop the object some in front (create the object a little in front)
instead of if enter on else, that create the object on plalyer position...


Code:

PlayerDropACadaver(playerid, cid, bool:onHands = false) {
    DestroyObject(CadaverObject[cid]);
    GetPlayerPos(playerid, CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseZ] );
    GetPlayerFacingAngle(playerid, CadaverInfo[cid][corpseR]);
    // [2907]Torso [2908]Head [2906]Arm [2905]Leg
    if(onHands == true) {
        GetXYFront(CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseR], 1.0)
        CadaverObject[cid] = CreateObject(2907, CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseZ]-1, CadaverInfo[cid][corpseR], 0.0, 0.0);;
    }
    else {
        CadaverObject[cid] = CreateObject(2907, CadaverInfo[cid][corpseX], CadaverInfo[cid][corpseY], CadaverInfo[cid][corpseZ]-1, CadaverInfo[cid][corpseR], 0.0, 0.0);
    }
    CadaverInfo[cid][corpseStatus] = 0;
    PlayerCadaverInHands[playerid] = 0;
    CadaverInfo[cid][hoursToDestroy] = 3;
}

Show higher admins ranks in descending order

$
0
0
Hello i created same thread few days ago but some told me it can be done with GetPlayerPoolSize and i was using old version that time so that function was not defined, however now i managed to update my script to latest version and now i have GetPlayerPoolSize function, can please explain me now to show higher ranks first?

PHP Code:

CMD:admins playerid )
{
    new 
0str[800], AdminRank[150];
    if (
PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessageplayerid, -1""RED"ERROR: "WHITE"You must be logged in");
    for (new 
0MAX_PLAYERSi++)
    {
        if (
IsPlayerConnected(i))
        {
            switch(
PlayerInfo[i][Admin])
            {
            case 
1AdminRank "Moderator";
            case 
2AdminRank "Administrator";
            case 
3AdminRank "Super Administrator";
            case 
4AdminRank "Server Manager";
            case 
5AdminRank "Server Developer";
            }

            if (
PlayerInfo[i][Admin] >= 1)
            {
                
c++;
                 if(
c==1)
                   {
                    
format(strsizeof(str), ""CASH"%s {F55F3D}%s\n"GetName(i), AdminRank);
                }
                  if(
>=2)
                {
                    
format(strsizeof(str), "\n%s"CASH"%s {F55F3D}%s\n"strGetName(i), AdminRank );
                 }
            }
        }
    }
    if (
== 0) return SendClientMessage(playerid, -1""RED"There are no Administrator online at the moment!");
    
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_LIST""CASH"Administrators Online"str"OK""");
    return 
1;


Thanks in advance

Collection Problem (Variables)

$
0
0
Hello, I want to do the following:

new Variable[2]; // Max String 1000

when Variable[0] is full (1000)

to move on to the next one which is not until or is still needed ( Variable[1] )

and if Variable[1] is full to work to Variable[0]

and if ex: put 50 in Variable[1] but Variable[1] is 996 (only 4 more can put) and the rest (46) to put in Variable[2]

* My experimental script:

PHP Code:

BankMoney(money)
{
    new 
vr[224], B;
    for(new 
i5i++)
    {
        if(
EconomyServer[i] < 1000)
        {
            new 
moneyEconomyServer[i];
            
money A;
            
EconomyServer[i] += A;
            
mysql_format(SQLvrsizeof(vr), "UPDATE `Economy_Server` SET `General.Economy`= '%d', `General.Economy2`= '%d', `General.Economy3`= '%d', `General.Economy4`= '%d', `General.Economy5`= '%d'"EconomyServer[0], EconomyServer[1], EconomyServer[2], EconomyServer[3], EconomyServer[4]);
            
mysql_query(SQLvr);
             print(
vr);
            if(
0)
            {
                
BankMoney(B);
                break;
            }
            else return 
1;
           
// break;
        
}
    }
    return 
0;


it does not work or exceeds the maximum (1000) or nothing happens

Textdraw Color Saving

$
0
0
How can I save textdraw's color? For example, when I press M key, my script will display a red textdraw, and when I press change color button, my script will remember what color that I have change (for example: blue), and next time when I press M key, my script will display a blue textdraw. How can I do that?
Thanks for answers!

[Ajuda] criar concessionaria

$
0
0
to tentando fazer um gm rp, e tenho duvida de como fazer uma conce, alguem pode me ajudar como fazer?

OBS: Nao quero codigo pronto, apenas as funcoes e logicas que podera servir para eu fazer este sistema.

[Ajuda] novo hack

$
0
0
Galera tem um cleo, que precisa do sampfuncs, você aperta a tecla Z e todos jogadores perto fica parados 'ESC' e se você aperta Z novamente os players voltam aonde estão normal, eu abri o arquivo e dentro tem isso.

Code:

{$CLEO .cs}
{$INCLUDE SF}
0000:
repeat

wait 0

until samp.Available()

$sync = true
   
0BE4: raknet setup_incoming_packet_hook @InPacketHook
0BE3: raknet setup_incoming_rpc_hook @InRpcHook

while true
wait 0
    if key_down 0x5A
    then
        0B12: $sync = $sync XOR 1       
        wait 1500
    end
end

:InRpcHook
wait 0
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SCRSETPLAYERHEALTH
then
    0BE0: raknet hook_ret $sync
end
0BE0: raknet hook_ret true

:InPacketHook
wait 0
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if or
    0@ == PACKET_PLAYER_SYNC
    0@ == PACKET_VEHICLE_SYNC
    0@ == PACKET_PASSENGER_SYNC
    0@ == PACKET_BULLET_SYNC
then
    0BE0: raknet hook_ret $sync
end
0BE0: raknet hook_ret true

alguem tem alguma ideia ou consiga criar um anti xiter disso? creio que sejá possivel somente pelo raknet

SetPlayerMarkerForPlayer

$
0
0
Hello everyone! I have a problem with SetPlayerMarkerForPlayer and i don't know how to solve it. When i set a leader (/setleader) I see on the minimap the marker of the player to whom I gave the leader.

Code:

public OnPlayerStreamIn(playerid, forplayerid) {
        new iswar = 0, attackers, defenders, no;
    if(GoChase[playerid] != -1) ShowPlayerNameTagForPlayer(forplayerid, playerid, 0);
    for(new i = 1; i < sizeof(Turfs) && iswar == 0; i++)  {
        attackers = WarInfo[i][wAttacker];
                defenders = WarInfo[i][wFaction];
        if(WarInfo[i][wTime] > 1 && attackers != 0 && defenders != 0) {
                        if((PlayerInfo[playerid][pMember] == attackers || PlayerInfo[playerid][pMember] == defenders) && (PlayerInfo[forplayerid][pMember] == attackers || PlayerInfo[forplayerid][pMember] == defenders)) iswar = 1;
                }
    }
        if(PlayerInfo[playerid][pWantedLevel] >= 1 && IsACop(forplayerid) && OnDuty[forplayerid] == 1) no = 1;
        if(iswar == 1) {
                if((PlayerInfo[playerid][pMember] == attackers || PlayerInfo[playerid][pMember] == defenders) && (PlayerInfo[forplayerid][pMember] == attackers || PlayerInfo[forplayerid][pMember] == defenders)) {
                        SetPlayerMarkerForPlayer(playerid, forplayerid, GetPlayerColor(forplayerid));
                        SetPlayerMarkerForPlayer(forplayerid, playerid, GetPlayerColor(playerid));
                }
                else {
                        if(no == 0) {
                                SetPlayerMarkerForPlayer(playerid, forplayerid, (GetPlayerColor(forplayerid) & 0xFFFFFF00));
                                SetPlayerMarkerForPlayer(forplayerid, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
                        }
                }
        }
        else {
                if(no == 0) {
                        SetPlayerMarkerForPlayer(playerid, forplayerid, (GetPlayerColor(forplayerid) & 0xFFFFFF00));
                        SetPlayerMarkerForPlayer(forplayerid, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
                }
        } 
        return 1;
}
function SetPlayerToTeamColor(playerid) {
        if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 1) {
                  SetPlayerColor(playerid, COLOR_WHITE);
                  switch(PlayerInfo[playerid][pMember]) {
                          case 1: SetPlayerColor(playerid, 0x0000FFFF);
                          case 2: SetPlayerColor(playerid, 0x0000FFFF);
                          case 3: SetPlayerColor(playerid, 0x00006AFF);
                          case 4: SetPlayerColor(playerid, 0x18EBD6C8);
                          case 5: SetPlayerColor(playerid, 0x40863CAA);
                          case 6: SetPlayerColor(playerid, 0xFFAE00C8);
                          case 8: SetPlayerColor(playerid, 0x3754C8C8);
                          case 9: SetPlayerColor(playerid, 0xEFC6FFFF);
                          case 10: SetPlayerColor(playerid, 0xBD1CDEC8);
                          case 11: SetPlayerColor(playerid, 0xAA3333AA);
                          case 12: SetPlayerColor(playerid, 0x00D179FF);
                          case 13: SetPlayerColor(playerid, COLOR_YELLOW);
                          case 14: SetPlayerColor(playerid, 0xf86448FF);
                          default: SetPlayerColor(playerid, COLOR_WHITE);
                  }             
              if(PlayerInfo[playerid][pPaintBallG] > 0) SetPlayerColor(playerid, 0xff6464FF);
    }
    return 1;
}
CMD:setleader(playerid, params[]) {
        if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "You need to login first.");
        if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_RED2, AdminOnly);
        new id,level;
        if(sscanf(params, "ui",id,level)) {
            SCM(playerid, COLOR_WHITE, "{CF0000}Usage: {FFFFFF}/setleader <Name/Playerid> <Number(1-14)>");
                SCM(playerid, COLOR_WHITE, "{FFF8C6}(1) LSPD (2) FBI (3) National Guard (4) Los Aztecas");
                SCM(playerid, COLOR_WHITE, "{FFF8C6}(5) Grove Street (6) Los Vagos (8) LVPD");
                SCM(playerid, COLOR_WHITE, "{FFF8C6}(9) News Reporter (10) Ballas (11) Hitman Agency (12) School Instructors");
                SCM(playerid, COLOR_WHITE, "{FFF8C6}(13) Los Santos Taxi (14) Paramedic");
                return 1;
        }
        if(level > 14 || level < 1) return SCM(playerid, COLOR_WHITE,"Dont go below number 1, or above number 14.");
        if(level == 7) return SCM(playerid, COLOR_WHITE,"Aceasta factiune nu mai exista.");
    if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY, "Player not connected.");
    if(PlayerInfo[id][pMember] > 0 || PlayerInfo[id][pLeader] > 0) return SS(playerid,COLOR_WHITE,"Acel jucator este deja intr-o factiune.","That player is in a faction.");
        new query[256],string[128]; 

        format(string, sizeof(string), "Admin %s has set you to lead group %s.", GetName(playerid), NumeFactiune(level));
        SCM(id, COLOR_ADMCOMMANDS, string);

        format(string, sizeof(string), "<< Admin %s has set %s to lead group %s >>", GetName(playerid), GetName(id), NumeFactiune(level));
        ABroadCast(COLOR_GENANNOUNCE2,string,1);

        format(string, sizeof(string), "%s is now the leader of faction %s (promoted by %s).", PlayerInfo[id][pNormalName], NumeFactiune(level), PlayerInfo[playerid][pNormalName]);
        mysql_format(SQL, query, sizeof(query), "INSERT INTO `faction_logs` (`text`, `player`, `leader`) VALUES ('%s', '%d', '%d')", string, PlayerInfo[id][pSQLID], PlayerInfo[playerid][pSQLID]);
        mysql_tquery(SQL,query,"","");

        format(string, sizeof(string), "You are now leader of faction %s.", NumeFactiune(level));
        mysql_format(SQL, query, sizeof(query), "INSERT INTO `emails` (`playerid`, `Message`) VALUES('%d','%s')", PlayerInfo[id][pSQLID], string);
        mysql_tquery(SQL,query,"","");
        PlayerInfo[id][pMember] = level;
        PlayerInfo[id][pLeader] = level;
    PlayerInfo[id][pRank] = 7;
        switch(level) {
                case 1: PlayerInfo[id][pModel] = 304;
                case 2: PlayerInfo[id][pModel] = 286;
                case 3: PlayerInfo[id][pModel] = 273;
                case 4: PlayerInfo[id][pModel] = 113;
                case 5: PlayerInfo[id][pModel] = 270;
                case 6: PlayerInfo[id][pModel] = 109;
                case 8: PlayerInfo[id][pModel] = 304;
                case 9: PlayerInfo[id][pModel] = 147;
                case 10: PlayerInfo[id][pModel] = 296;
                case 11: PlayerInfo[id][pModel] = 294;
                case 12: PlayerInfo[id][pModel] = 189;
                case 13: PlayerInfo[id][pModel] = 228;
                case 14: PlayerInfo[id][pModel] = 279;
                default: PlayerInfo[id][pModel] = 37;
        }
    switch(level) {
            case 1, 2, 3, 7, 8: {
                    gTeam[id] = 2;
                    PlayerInfo[id][pTeam] = 2;
            }
            case 4, 5, 6, 10: {
                    gTeam[id] = 5;
                    PlayerInfo[id][pTeam] = 5;
            }
            case 9, 12, 13, 14: {
                    gTeam[id] = 4;
                    PlayerInfo[id][pTeam] = 4;
            }
            case 11: {
                    gTeam[id] = 11;
                    PlayerInfo[id][pTeam] = 11;
            }
    }
    SetPlayerSkin(id, PlayerInfo[id][pModel]); 
    PlayerInfo[id][pALeader] = 0;
        new str[256];
        mysql_format(SQL, str, sizeof(str), "UPDATE `users` SET `ALeader`='0', `Leader`='%d',`Member`='%d',`Rank`='7',`Team`='%d',`Model`='%d' WHERE `name`='%s'",PlayerInfo[id][pLeader],PlayerInfo[id][pMember],PlayerInfo[id][pTeam],PlayerInfo[id][pModel],PlayerInfo[id][pNormalName]);
        mysql_tquery(SQL, str, "", "");   
        SetPlayerToTeamColor(id);
        return 1;
}

If you could help me... I have also setplayermarkerforplayer in a timer

Code:

        foreach(Player, i) {
                if(IsACop(i)) {
                        foreach(Player, j) {
                                if(PlayerInfo[j][pWantedLevel] >= 1) {
                                        SetPlayerMarkerForPlayer(i, j, (0xFF2B5D72 & 0xFFFFFF00));
                                }
                        }
                }
        }

sorry for bad english

anti cheat

$
0
0
Galera tem um cleo, que precisa do sampfuncs, você aperta a tecla Z e todos jogadores perto fica parados 'ESC' e se você aperta Z novamente os players voltam aonde estão normal, eu abri o arquivo e dentro tem isso.

Guys have a core, which needs sampfuncs, you press Z and all nearby players to stand still 'ESC' and if you press Z again when players are again isolated, I opened the file and inside it.

Code:

{$CLEO .cs}
{$INCLUDE SF}
0000:
repeat

wait 0

until samp.Available()

$sync = true
   
0BE4: raknet setup_incoming_packet_hook @InPacketHook
0BE3: raknet setup_incoming_rpc_hook @InRpcHook

while true
wait 0
    if key_down 0x5A
    then
        0B12: $sync = $sync XOR 1       
        wait 1500
    end
end

:InRpcHook
wait 0
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if 0@ == RPC_SCRSETPLAYERHEALTH
then
    0BE0: raknet hook_ret $sync
end
0BE0: raknet hook_ret true

:InPacketHook
wait 0
0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
if or
    0@ == PACKET_PLAYER_SYNC
    0@ == PACKET_VEHICLE_SYNC
    0@ == PACKET_PASSENGER_SYNC
    0@ == PACKET_BULLET_SYNC
then
    0BE0: raknet hook_ret $sync
end
0BE0: raknet hook_ret true

alguem tem alguma ideia ou consiga criar um anti xiter disso? creio que sejá possivel somente pelo raknet


Does anyone have any ideas or can create an anti xiter of this? I think it is possible only by raknet

[Ajuda] codigo

$
0
0
Olá estou com esse código que o player compra moedas,
Quero colocá-lo para comprar dinheiro com moedas,
Quem poder editá-lo por favor, pois não sei fazer isso.


PHP Code:

                 if(PlayerInfo[playerid][pMoedasFree] > 2)
                 {
                     return 
SendClientMessage(playerid, -1"Você só pode comprar 2 vezes Moedas Na loja FREE.");
                 }
                if(
GetPlayerMoneyEx(playerid) < 20000000 && PlayerInfo[playerid][pConta] < 20000000)
                {
                    return 
SendClientMessage(playeridCOR_GRAD1"Você deve possuir 20kk em sua mão ou em sua conta bancária.");
                }
                if(
GetPlayerMoneyEx(playerid) > 20000000)
                {
                    
GivePlayerMoneyEx(playerid, -20000000);
                    
SendClientMessage(playeridCOR_AMARELO"Sua compra foi finalizada com o dinheiro que estava na mão.");
                }
                else if(
PlayerInfo[playerid][pConta] > 20000000)
                {
                    
PlayerInfo[playerid][pConta] -= 20000000;
                    
SendClientMessage(playeridCOR_AMARELO"Sua compra foi finalizada com o dinheiro que estava em sua conta bancária.");
                }
                
PlayerInfo[playerid][pMoedasFree] += 1;
                
PlayerInfo[playerid][pMoedas] += 1;
                
format(MEGAStringsizeof(MEGAString),"{F4FA58}[Loja FREE] {2ECCFA}O Jogador %s comprou {2EFE2E}1 Moedas{2ECCFA} com dinheiro in-game, para adquirir use: /menuvip.",PlayerName(playerid));
                
SendClientMessageToAll(-1MEGAString);
                
LojaFreeLog(MEGAString);
                return 
1;
             } 

[Ajuda] Carro forte "Erro"

$
0
0
Attachment 12597

O comando simplesmente naao reconhece o carro ou quando mudo diz que nao existe ja fizz de tuudo e nnao da certoo

Quote:

CMD:guardardinheiro(playerid)
{
if(PlayerInfo[playerid][pEmprego] != 16)
return SendClientMessage(playerid, COLOR_GREY, " Você não é um motorista de carro forte.");

new vehicleid = PegarVeiculoMaisPerto(playerid, 15.0);
if(vehicleid == INVALID_VEHICLE_ID)
return SendClientMessage(playerid, -1, "Você não está proximo de um carro forte.");

if(!IsACFCar(vehicleid))
return SendClientMessage(playerid, -1, "Esse veículo não é um carro forte.");

new Float:X, Float:Y, Float:Z;
GetVehicleBoot(vehicleid, X, Y, Z);
if(GetPlayerDistanceFromPoint(playerid, X, Y, Z) > 1.0)
return SendClientMessage(playerid, -1, "Você não está na traseira do veículo.");

new index = GetCFIndex(vehicleid);
if(vDinheiro[index] >= 10000)
return SendClientMessage(playerid, -1, "Já tem muito dinheiro nesse veículo.");

vDinheiro[index] += pDinheiro[playerid];
pDinheiro[playerid] = 0;
new string[128];
format(string, sizeof string, "{FFFFFF}Dinheiro: [{33AA33}$%s{FFFFFF}]", SepararGrana(vDinheiro[index]));
UpdateDynamic3DTextLabelText(CarrosFortesLabel[index], COLOR_GREEN, string);
format(string, sizeof(string), "* %s colocou algum dinheiro dentro do carro forte.", NomePlayer(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
RemovePlayerAttachedObject(playerid, Vaga_Pa);
return 1;
}

CMD:pegardinheiro(playerid)
{
if(PlayerInfo[playerid][pEmprego] != 16)
return SendClientMessage(playerid, COLOR_GREY, " Você não é um motorista de carro forte.");

new vehicleid = PegarVeiculoMaisPerto(playerid, 15.0);
if(vehicleid == INVALID_VEHICLE_ID)
return SendClientMessage(playerid, -1, "Você não está proximo de um carro forte.");

if(!IsACFCar(vehicleid))
return SendClientMessage(playerid, -1, "Esse veículo não é um carro forte.");

new Float:X, Float:Y, Float:Z;
GetVehicleBoot(vehicleid, X, Y, Z);
if(GetPlayerDistanceFromPoint(playerid, X, Y, Z) > 1.0)
return SendClientMessage(playerid, -1, "Você não está na traseira do carro forte.");

new index = GetCFIndex(vehicleid);
if(vDinheiro[index] <= 0)
return SendClientMessage(playerid, -1, "Esse carro forte está vazio.");

if(vDinheiro[index] < 1000)
pDinheiro[playerid] += vDinheiro[index];
else
pDinheiro[playerid] = 1000, vDinheiro[index] -= 1000;

new string[128];
format(string, sizeof string, "{FFFFFF}Dinheiro: [{33AA33}$%s{FFFFFF}]", SepararGrana(vDinheiro[index]));
UpdateDynamic3DTextLabelText(CarrosFortesLabel[index], COLOR_GREEN, string);
format(string, sizeof(string), "* %s removeu algum dinheiro dentro do carro forte.", NomePlayer(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SetPlayerAttachedObject(playerid, Vaga_Pa, 1550, 1, 0.024558, -0.279748, -0.060589, 6.105677, 137.291320, 147.132202, 1.019888, 1.000000, 1.000000);
return 1;
}

CMD:marcarcaixa(playerid)
{
if(PlayerInfo[playerid][pEmprego] != 16)
return SendClientMessage(playerid, COLOR_GREY, " Você não é um motorista de carro forte.");
new Float:X, Float:Y, Float:Z;
if(CaixaSel[playerid] != -1)
{
GetDynamicObjectPos(CaixaInfo[CaixaSel[playerid]][Caixa_Object], X, Y, Z);
SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
return SendClientMessage(playerid, -1, "Você já marcou um caixa, faça a sua entrega para poder marcar outro.");
}
new maxcaixa;
for(new i; i < MAX_CAIXAS; i ++)
{
if(CaixaInfo[i][Caixa_Valido])
maxcaixa++;
}
Retornar:
new aleatorio = random(maxcaixa);
if(CaixaAntigo[playerid] != -1 && aleatorio == CaixaAntigo[playerid])
goto Retornar;
CaixaSel[playerid] = aleatorio;
GetDynamicObjectPos(CaixaInfo[aleatorio][Caixa_Object], X, Y, Z);
SetPlayerCheckpoint(playerid, X, Y, Z, 5.0);
return 1;
}

Attached Images
File Type: jpg sa-mp-001.jpg (194.8 KB)

[Ajuda] Checkpoints Dinamicos

$
0
0
Comecei a utilizar Checkpoints Dinamicos do plugin streamer, porém, por algum motivo, quando entro em qualquer checkpoint nada acontece:

Um dos codigos:
PHP Code:

new CheckpointOnibus[MAX_PLAYERS][3];
CheckpointOnibus[playerid][0] = CreateDynamicCP(1758.5988, -1826.465113.480410.000playerid100.0);
SetPlayerMapIcon(playerid01758.5988, -1826.465113.480400xFF0000FFMAPICON_GLOBAL); 

PHP Code:

public OnPlayerEnterDynamicCP(playeridcheckpointid
{
if(
checkpointid == CheckpointOnibus[playerid][0])
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 431)
        {
            
DestroyDynamicCP(CheckpointOnibus[playerid][0]);
            
ResetCheckpoints(playerid);
            
TogglePlayerControllable(playerid0);
            
SendClientMessage(playeridCOR_AMARELO"[ONIBUS] Aguarde 10 segundos para o proximo ponto...");
            
TimerParadaOnibus[playerid] = SetTimerEx("ParadaOnibus"segundos(10), false"i"playerid);
        }else{ 
SendClientMessage(playerid,COLOR_ERROR,"|BMRP| Erro: Voce nao esta em um Onibus!"); }
    }
return 
1;


Todos os demais checkpoints são feitos desta maneira, mas por algum motivo, quando entro no checkpoint não acontece nada, ele só some.

House descriptions not showing

$
0
0
Hi
Before i change somethings in gamemode house descriptions loading perfectly but when i changed something its not showing anymore, i checked the codes that i changed but nothing suspicious.
any guide?
Viewing all 18226 articles
Browse latest View live


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