Szerző Téma: Banda rendszer  (Megtekintve 990 alkalommal)

Banda rendszer
« Dátum: 2012. Június 13. - 17:17:46 »
0 Show voters
Üdv mindenki! Ahogy a cím is írja, egy banda rendszert szeretnék kérni tõletek, ha valakinek van egy kis felesleges ideje. Úgy kéne, hogy van alapból 4 frakció (corleone, groove, alcapone, fbi). Mindegyiknél lenne banda chat, amit csak az a banda lát. Csak rcon-admin tudna kinevezni fõ-leadert, amit csak rcon-admin tud elvenni tõle (5-ös szint lenne ez). Ez nem olyan fontos, csak az e lényeg, hogy az 5-ös a vezetõ és az 5-ös tud rangot adni (ez lenne a meghívás is, tehát ha 1-es rangot ad egy 0-snak, akkor meghívja, ha meg fordítva, akkor kirúgja). Ezt csak az 5-ös tudná megcsinálni. Mindegyiknél lenne külön banda-szín. Ez azt takarja, hogyha egy adott bandában van, akkor mindíg olyan lesz a nevének a színe, amilyen a banda-szín, amíg meg nem változtatja megának a player, de minden spawnnál, vagy connectnél az lenne a színe. A 3 bandának (tehát az FBI-on kívül) lenne banda-széfje, ahova pénzt berakni nem tudnak, de a 3 banda egymást ki tudja rabolni, ha a széf elõtt áll 99mp-ig és mondjuk 500k-tól 1 milláig valamennyi pénzt kapnak, ha ez letelt. Az FBI el tudja õket kapni, börtönbe zárja, mint az admin, de nem szabhatja meg mennyi idõre, mondjuk 99mp-re. Nagyjából ennyi, a széfek mindegy hol vannak, majd rakosgatom úgyis õket.
Kb ilyen van a stuntlife szerón is, de gondoltam le is írom.
Köszönet és respect elõre is

Banda rendszer
« Válasz #1 Dátum: 2012. Június 13. - 19:01:22 »
+1 Show voters
Hali.
Megcsináltam egy részét, de lehet vannak benne hibák. Ha találsz, szólsz, nem teszteltem, csak megírtam.
A széfes cuccot nem volt most kedvem megcsinálni, talán majd késõbb, de nem biztos. A mentést nem csinálom meg, remélem azt már te is megtudod. Ha a széfes dolgon kívül még kell valami help, akkor segítek.
 
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define COLOR_GREEN         0x33AA33AA
#define COLOR_BLUE          0x0000FFAA
#define COLOR_RED           0xFF0606FF
#define COLOR_YELLOW        0xFFFF00AA
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_WHITE         0xFFFFFFAA
#define COLOR_BROWN         0x993300AA
#define COLOR_ORANGE        0xFF9933AA
#define COLOR_BLACK         0x000000AA
#define COLOR_LIGHTBLUE     0x00BFFFAA
#define COLOR_PINK          0xFF66FFAA
#define COLOR_LIGHTGREEN    0x90EE90FF
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Banda by Ryuuzaki\");
print(\"--------------------------------------\\n\");
return 1;
}
CMD:leaderad(playerid, params[])
{
new frakciok[32], id, name1[24], name2[24], string[128];
if(!IsPlayerAdmin(playerid)) return 0;
else if(sscanf(params, \"is[32]\", id, frakciok)) SendClientMessage(playerid, COLOR_GREY, \"Használat: /leaderad [iD] [Corleone/Groove/Alcapone/FBI]\");
else if(!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nincs csatlakozva!\");
else if(GetPVarInt(id, \"Corleone\") == 5 || GetPVarInt(id, \"Groove\") == 5 || GetPVarInt(id, \"Alcapone\") == 5 || GetPVarInt(id, \"FBI\") == 5) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos már Leader!\");
else
{
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
if(strcmp(frakciok, \"Corleone\") == 0)
{
    SetPVarInt(id, \"Corleone\", 5);
    format(string, sizeof(string), \"%s Adminisztrátor felvett Leadernek a Corleone-ba.\", name1);
    SendClientMessage(id, COLOR_YELLOW, string);
    format(string, sizeof(string), \"Leadert adtál %s-nek a Corleone-ba.\", name2);
    SendClientMessage(playerid, COLOR_GREEN, string);
}
else if(strcmp(frakciok, \"Groove\") == 0)
{
    SetPVarInt(id, \"Groove\", 5);
    format(string, sizeof(string), \"%s Adminisztrátor felvett Leadernek a Groove-ba.\", name1);
    SendClientMessage(id, COLOR_YELLOW, string);
    format(string, sizeof(string), \"Leadert adtál %s-nek a Groove-ba.\", name2);
    SendClientMessage(playerid, COLOR_GREEN, string);
}
else if(strcmp(frakciok, \"Alcapone\") == 0)
{
    SetPVarInt(id, \"Alcapone\", 5);
    format(string, sizeof(string), \"%s Adminisztrátor felvett Leadernek az Alcapone-ba.\", name1);
    SendClientMessage(id, COLOR_YELLOW, string);
    format(string, sizeof(string), \"Leadert adtál %s-nek az Alcapone-ba.\", name2);
    SendClientMessage(playerid, COLOR_GREEN, string);
}
else if(strcmp(frakciok, \"FBI\") == 0)
{
    SetPVarInt(id, \"FBI\", 5);
    format(string, sizeof(string), \"%s Adminisztrátor felvett Leadernek az FBI-ba.\", name1);
    SendClientMessage(id, COLOR_YELLOW, string);
    format(string, sizeof(string), \"Leadert adtál %s-nek az FBI-hoz.\", name2);
    SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
}
CMD:leaderel(playerid, params[])
{
new id, name1[24], name2[24], string[128];
if(!IsPlayerAdmin(playerid)) return 0;
else if(sscanf(params, \"i\", id)) SendClientMessage(playerid, COLOR_GREY, \"Használat: /leaderel [iD]\");
else if(!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nincs csatlakozva!\");
else if(GetPVarInt(id, \"Corleone\") != 5 && GetPVarInt(id, \"Groove\") != 5 && GetPVarInt(id, \"Alcapone\") != 5 && GetPVarInt(id, \"FBI\") != 5) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem Leader!\");
else
{
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(id, name2, sizeof(name2));
SetPVarInt(id, \"Leader\", 0);
format(string, sizeof(string), \"%s Adminisztrátor elvette a Leaderedet.\", name1);
SendClientMessage(id, COLOR_GREY, string);
format(string, sizeof(string), \"Elvetted %s-tól/tõl a Leadert.\", name2);
SendClientMessage(playerid, COLOR_GREEN, string);
}
return 1;
}
CMD:felvesz(playerid, params[])
{
new id, string[128], name1[24], name2[24];
if(GetPVarInt(playerid, \"Corleone\") != 5 || GetPVarInt(playerid, \"Groove\") != 5 || GetPVarInt(playerid, \"Alcapone\") != 5 || GetPVarInt(playerid, \"FBI\") != 5) SendClientMessage(playerid, COLOR_RED, \"HIBA: Nem vagy Leader!\");
else if(sscanf(params, \"i\", id)) SendClientMessage(playerid, COLOR_GREY, \"Használat: /felvesz [iD]\");
else if(id == playerid) SendClientMessage(playerid, COLOR_RED, \"Magadat nem veheted fel!\");
else if(!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nincs csatlakozva!\");
else if(GetPVarInt(id, \"Corleone\") >= 1 || GetPVarInt(id, \"Groove\") >= 1 || GetPVarInt(id, \"Alcapone\") >= 1 || GetPVarInt(id, \"FBI\") >= 1) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos már egy frakció tagja!\");
else
{
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
    if(GetPVarInt(playerid, \"Corleone\") == 5)
    {
        SetPVarInt(id, \"Corleone\", 1);
        format(string, sizeof(string), \"%s Corleone Leader felvett téged a Corleone frakcióba.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Felvetted %s-t a Corleone frakcióba.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
}
if(GetPVarInt(playerid, \"Groove\") == 5)
    {
        SetPVarInt(id, \"Groove\", 1);
        format(string, sizeof(string), \"%s Groove Leader felvett téged a Groove frakcióba.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Felvetted %s-t a Groove frakcióba.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
}
if(GetPVarInt(playerid, \"Alcapone\") == 5)
    {
        SetPVarInt(id, \"Alcapone\", 1);
        format(string, sizeof(string), \"%s Alcapone Leader felvett téged a Alcapone frakcióba.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Felvetted %s-t a Alcapone frakcióba.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
}
if(GetPVarInt(playerid, \"FBI\") == 5)
    {
        SetPVarInt(id, \"FBI\", 1);
        format(string, sizeof(string), \"%s FBI Leader felvett téged a FBI frakcióba.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Felvetted %s-t a FBI frakcióba.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
}
}
return 1;
}
 
CMD:kirug(playerid, params[])
{
new id, string[128], name1[24], name2[24];
if(GetPVarInt(playerid, \"Corleone\") != 5 || GetPVarInt(playerid, \"Groove\") != 5 || GetPVarInt(playerid, \"Alcapone\") != 5 || GetPVarInt(playerid, \"FBI\") != 5) SendClientMessage(playerid, COLOR_RED, \"HIBA: Nem vagy Leader!\");
else if(sscanf(params, \"i\", id)) SendClientMessage(playerid, COLOR_GREY, \"Használat: /kirug [iD]\");
else if(id == playerid) SendClientMessage(playerid, COLOR_RED, \"Magadat nem rúghatod ki!\");
else if(!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nincs csatlakozva!\");
else
{
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
    if(GetPVarInt(playerid, \"Corleone\") == 5)
    {
        if(GetPVarInt(id, \"Corleone\") >= 1)
        {
        SetPVarInt(id, \"Corleone\", 0);
        format(string, sizeof(string), \"%s Corleone Leader kirúgott téged a Corleone frakcióból.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Kirúgtad %s-t a Corleone frakcióból.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"Groove\") == 5)
    {
        if(GetPVarInt(id, \"Groove\") >= 1)
        {
        SetPVarInt(id, \"Groove\", 0);
        format(string, sizeof(string), \"%s Groove Leader kirúgott téged a Groove frakcióból.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Kirúgtad %s-t a Groove frakcióból.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"Alcapone\") == 5)
    {
        if(GetPVarInt(id, \"Alcapone\") >= 1)
        {
        SetPVarInt(id, \"Alcapone\", 0);
        format(string, sizeof(string), \"%s Alcapone Leader kirúgott téged a Alcapone frakcióból.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Kirúgtad %s-t a Alcapone frakcióból.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"FBI\") == 5)
    {
        if(GetPVarInt(id, \"FBI\") >= 1)
        {
        SetPVarInt(id, \"FBI\", 0);
        format(string, sizeof(string), \"%s FBI Leader kirúgott téged a FBI frakcióból.\", name1);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Kirúgtad %s-t a FBI frakcióból.\", name2);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
}
return 1;
}
CMD:giverank(playerid, params[])
{
new id, rang, string[128], name1[24], name2[24];
if(GetPVarInt(playerid, \"Corleone\") != 5 || GetPVarInt(playerid, \"Groove\") != 5 || GetPVarInt(playerid, \"Alcapone\") != 5 || GetPVarInt(playerid, \"FBI\") != 5) SendClientMessage(playerid, COLOR_RED, \"HIBA: Nem vagy Leader!\");
else if(sscanf(params, \"ii\", id, rang)) SendClientMessage(playerid, COLOR_GREY, \"Használat: /giverank [iD] [rang(1-4)]\");
else if(id == playerid) SendClientMessage(playerid, COLOR_RED, \"Magadnak nem adhatsz rangot!\");
else if(!IsPlayerConnected(id)) SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nincs csatlakozva!\");
else if(1 > rang || rang > 4) SendClientMessage(playerid, COLOR_RED, \"HIBA: A rangnak 1 és 4 közt kell lennie!\");
else
{
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(id, name2, sizeof(name2));
    if(GetPVarInt(playerid, \"Corleone\") == 5)
    {
        if(GetPVarInt(id, \"Corleone\") >= 1)
        {
        SetPVarInt(id, \"Corleone\", rang);
        format(string, sizeof(string), \"%s Corleone Leader megváltoztatta a rangod erre: %d\", name1, rang);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Megváltoztattad %s rangját erre: %d\", name2, rang);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"Groove\") == 5)
    {
        if(GetPVarInt(id, \"Groove\") >= 1)
        {
        SetPVarInt(id, \"Groove\", rang);
        format(string, sizeof(string), \"%s Groove Leader megváltoztatta a rangod erre: %d\", name1, rang);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Megváltoztattad %s rangját erre: %d\", name2, rang);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"Alcapone\") == 5)
    {
        if(GetPVarInt(id, \"Alcapone\") >= 1)
        {
        SetPVarInt(id, \"Alcapone\", rang);
        format(string, sizeof(string), \"%s Alcapone Leader megváltoztatta a rangod erre: %d\", name1, rang);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Megváltoztattad %s rangját erre: %d\", name2, rang);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
if(GetPVarInt(playerid, \"FBI\") == 5)
    {
        if(GetPVarInt(id, \"FBI\") >= 1)
        {
        SetPVarInt(id, \"FBI\", rang);
        format(string, sizeof(string), \"%s FBI Leader megváltoztatta a rangod erre: %d\", name1, rang);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), \"Megváltoztattad %s rangját erre: %d\", name2, rang);
        SendClientMessage(playerid, COLOR_GREEN, string);
   }
   else SendClientMessage(playerid, COLOR_RED, \"HIBA: A játékos nem a te frakciód tagja!\");
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, \"Corleone\") != 0)
{
    SetPlayerColor(playerid, COLOR_YELLOW);//szín
    //ide még amik kellenek a frakcióhoz
}
else if(GetPVarInt(playerid, \"Groove\") != 0)
{
    SetPlayerColor(playerid, COLOR_GREEN);//szín
    //ide még amik kellenek a frakcióhoz
}
else if(GetPVarInt(playerid, \"Alcapone\") != 0)
{
    SetPlayerColor(playerid, COLOR_ORANGE);//szín
    //ide még amik kellenek a frakcióhoz
}
else if(GetPVarInt(playerid, \"FBI\") != 0)
{
    SetPlayerColor(playerid, COLOR_BLUE);//szín
    //ide még amik kellenek a frakcióhoz
}
return 1;
}
public OnPlayerText(playerid, text[])
{
if(text[0] == \'!\')
{
new string[200];
new name1[24];
GetPlayerName(playerid, name1, sizeof(name1));
format(string, sizeof(string),\"[TeamChat]%s: %s\", name1, text[1]);
if(GetPVarInt(playerid, \"Corleone\") >= 1)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, \"Corleone\") >= 1) SendClientMessage(i, COLOR_YELLOW, string);
   }
}
if(GetPVarInt(playerid, \"Groove\") >= 1)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, \"Groove\") >= 1) SendClientMessage(i, COLOR_YELLOW, string);
   }
}
if(GetPVarInt(playerid, \"Alcapone\") >= 1)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, \"Alcapone\") >= 1) SendClientMessage(i, COLOR_YELLOW, string);
   }
}
if(GetPVarInt(playerid, \"FBI\") >= 1)
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, \"FBI\") >= 1) SendClientMessage(i, COLOR_YELLOW, string);
   }
}
}
return 1;
}

Nem elérhető zeteni

  • 1970
  • Ex-Scripter
    • Profil megtekintése
Banda rendszer
« Válasz #2 Dátum: 2012. Június 13. - 19:05:28 »
+1 Show voters
Nem olvastam el az egészet, de
 
new name1[24];

 
helyett
 
new name1[MAX_PLAYER_NAME];

 
És a neveknél így tovább ha létrehozod

Banda rendszer
« Válasz #3 Dátum: 2012. Június 13. - 19:12:44 »
0 Show voters
MAX_PLAYER_NAME = 24.

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Banda rendszer
« Válasz #4 Dátum: 2012. Június 13. - 19:41:24 »
+1 Show voters
Elég Amit le írt zeteni nem kell 24 ..

Banda rendszer
« Válasz #5 Dátum: 2012. Június 13. - 20:13:21 »
+1 Show voters
#define MAX_PLAYER_NAME                     (24)

 
a_samp include.
Magyarul édesmindegy, hogy melyiket írod. Kinek van kedve mindig leírni azt, hogy MAX_PLAYER_NAME?

Banda rendszer
« Válasz #6 Dátum: 2012. Június 13. - 20:59:00 »
0 Show voters
Köszönöm, ez nagyon sok segítség, természetesen ment a + . Még annyi, hogy kezdõ vagyok és sajna nem tudok mentést írni :S Ha esetleg valaki meg tudná oldani, örülnék neki.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal