Suche Job Script, kein GF

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Ich suche einen Job Script, wo man als Taxifahrer oder Sonstiges machen kann. Mein GM ist kein GF, es wird ein Stuntgamemode. Und von daher suche ich einen Job Script. Habe schon SuFu benutzt, der findet leider nichts.

    Gruß Nate

    2 Mal editiert, zuletzt von Nate ()

  • xD wenns ein StungGameMode seinn sol xD wieso dann jobs?=

  • Ok.Hier ein kleines Beispiel.

    // Ganz Oben
    new Jobs[MAX_PLAYERS];
    new Taxi[MAX_PLAYERS];
    new Dealer[MAX_PLAYERS];
    new Arzt[MAX_PLAYERS];
    new mats[MAX_PLAYERS];


    // Unter OnPlayerCommandText
    dcmd(job,3,cmdtext);
    dcmd(deal,4,cmdtext);
    dcmd(get,3,cmdtext);
    //Außerhalb eines CallBacks
    dcmd_deal(playerid,params[])
    {


    new form[100];
    new playa;
    new mat;
    if(sscanf(params,"dd",playa,mat))
    {
    SendClientMessage(playerid,COLOR_YELLOW,"Verwende: /deal [ID] [DROGENANZAHL]");
    return 1;
    }
    if(mat > mats[playerid])
    {
    SendClientMessage(playerid,COLOR_BLUE,"So viele drogen hast du nicht !");
    return 1;
    }
    if(!IsPlayerConnected(playa))
    {
    SendClientMessage(playerid,COLOR_BLUE,"Angegebener User nicht online!");
    return 1;
    }
    if(Dealer[playerid] == 1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playa,name,sizeof name);
    new name2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name2,sizeof name2);
    format(form,sizeof form,"Du hast %s %d Drogen gegeben",name,mat);
    SendClientMessage(playerid,COLOR_YELLOW,form);
    new Float:h;
    GetPlayerHealth(playa,h);
    SetPlayerHealth(playerid,h+mat);
    new form2[100];
    format(form2,sizeof form2,"Du hast von %s %d Drogen erhalten",name2,mat);
    SendClientMessage(playa,COLOR_YELLOW,form2);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_BLUE,"Du bist kein Dealer");
    return 1;
    }
    }
    dcmd_get(playerid, params[])
    {
    new form[100];
    new mat = strval(params);
    if(!strlen(params))
    {
    SendClientMessage(playerid,COLOR_YELLOW,"Verwende: /get [AMMOUNT]");
    return 1;
    }
    if(!PlayerToPoint(5.0,playerid,1958.33, 1343.12, 15.36))//Deine Koords
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist nicht am Drogen Ort");
    return 1;
    }
    if(Dealer[playerid] == 1)
    {
    ApplyAnimation(playerid,"DEALER","DEALER_DEAL",4.1,1,1,1,1,1);
    mats[playerid] += mat;
    //GivePlayerMoney(playerid,-500);
    format(form,sizeof form,"Du hast %d Drogen erworben",mat);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist kein Dealer");
    return 1;
    }}



    dcmd_job(playerid,params[])
    {
    new form[100];
    new name[MAX_PLAYER_NAME];
    new job[100];
    if(sscanf(params,"s",job))
    {
    SendClientMessage(playerid,COLOR_RED,"Verwende: /job [NAME]");
    SendClientMessage(playerid,COLOR_YELLOW,"===== JOBS =====");
    SendClientMessage(playerid,COLOR_BLUE," Taxifahrer , Arzt , Dealer ");
    SendClientMessage(playerid,COLOR_YELLOW,"===== JOBS =====");
    return 1;
    }
    if(strcmp(job,"Taxifahrer",true,strlen(job))==0)
    {
    Jobs[playerid] = 1;
    Taxi[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Taxifahrer");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Taxifahrer",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else if(strcmp(job,"Arzt",true,strlen(job)) ==0)
    {
    Jobs[playerid] = 1;
    Arzt[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Arzt");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Arzt (Medic)",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else if(strcmp(job,"Dealer",true,strlen(job)) ==0)
    {
    Jobs[playerid] = 1;
    Dealer[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Dealer");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Dealer",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Diesen Job gibt es nicht!");
    SendClientMessage(playerid,COLOR_BLUE,"Jobs: Taxifahrer , Dealer , Arzt ");
    return 1;
    }}


    //Unter OnPlayerSpawn
    Dealer[playerid] = 0;
    Jobs[playerid] = 0;
    Taxi[playerid] = 0;
    Arzt[playerid] = 0;





    Hoffe,dass alles stimmt,da ich es aus dem Kopf geschrieben habe.
    Befehle:
    /job - Man kann Taxifahrer,Arzt oder Dealer werden,wird nach dem Tod wieder zurückgestellt
    /get - Man kann Drogen erhalten
    /deal - Man kann jemanden Drogen geben,um dessen Health zu erhöhen

    Suche Scriptlehrer :rolleyes:

  • #include <a_samp>
    #pragma tabsize 0
    #if defined FILTERSCRIPT
    new Jobs[MAX_PLAYERS];
    new Taxi[MAX_PLAYERS];
    new Dealer[MAX_PLAYERS];
    new Arzt[MAX_PLAYERS];
    new mats[MAX_PLAYERS];


    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd(job,3,cmdtext);
    dcmd(deal,4,cmdtext);
    dcmd(get,3,cmdtext);
    //Außerhalb eines CallBacks
    dcmd_deal(playerid,params[])
    {


    new form[100];
    new playa;
    new mat;
    if(sscanf(params,"dd",playa,mat))
    {
    SendClientMessage(playerid,COLOR_YELLOW,"Verwende: /deal [ID] [DROGENANZAHL]");
    return 1;
    }
    if(mat > mats[playerid])
    {
    SendClientMessage(playerid,COLOR_BLUE,"So viele drogen hast du nicht !");
    return 1;
    }
    if(!IsPlayerConnected(playa))
    {
    SendClientMessage(playerid,COLOR_BLUE,"Angegebener User nicht online!");
    return 1;
    }
    if(Dealer[playerid] == 1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playa,name,sizeof name);
    new name2[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name2,sizeof name2);
    format(form,sizeof form,"Du hast %s %d Drogen gegeben",name,mat);
    SendClientMessage(playerid,COLOR_YELLOW,form);
    new Float:h;
    GetPlayerHealth(playa,h);
    SetPlayerHealth(playerid,h+mat);
    new form2[100];
    format(form2,sizeof form2,"Du hast von %s %d Drogen erhalten",name2,mat);
    SendClientMessage(playa,COLOR_YELLOW,form2);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_BLUE,"Du bist kein Dealer");
    return 1;
    }
    }
    dcmd_get(playerid, params[])
    {
    new form[100];
    new mat = strval(params);
    if(!strlen(params))
    {
    SendClientMessage(playerid,COLOR_YELLOW,"Verwende: /get [AMMOUNT]");
    return 1;
    }
    if(!PlayerToPoint(5.0,playerid,1958.33, 1343.12, 15.36))//Deine Koords
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist nicht am Drogen Ort");
    return 1;
    }
    if(Dealer[playerid] == 1)
    {
    ApplyAnimation(playerid,"DEALER","DEALER_DEAL",4.1,1,1,1,1,1);
    mats[playerid] += mat;
    //GivePlayerMoney(playerid,-500);
    format(form,sizeof form,"Du hast %d Drogen erworben",mat);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Du bist kein Dealer");
    return 1;
    }}



    dcmd_job(playerid,params[])
    {
    new form[100];
    new name[MAX_PLAYER_NAME];
    new job[100];
    if(sscanf(params,"s",job))
    {
    SendClientMessage(playerid,COLOR_RED,"Verwende: /job [NAME]");
    SendClientMessage(playerid,COLOR_YELLOW,"===== JOBS =====");
    SendClientMessage(playerid,COLOR_BLUE," Taxifahrer , Arzt , Dealer ");
    SendClientMessage(playerid,COLOR_YELLOW,"===== JOBS =====");
    return 1;
    }
    if(strcmp(job,"Taxifahrer",true,strlen(job))==0)
    {
    Jobs[playerid] = 1;
    Taxi[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Taxifahrer");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Taxifahrer",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else if(strcmp(job,"Arzt",true,strlen(job)) ==0)
    {
    Jobs[playerid] = 1;
    Arzt[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Arzt");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Arzt (Medic)",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else if(strcmp(job,"Dealer",true,strlen(job)) ==0)
    {
    Jobs[playerid] = 1;
    Dealer[playerid] = 1;
    SendClientMessage(playerid,COLOR_YELLOW,"***INFO: Du bist nun Dealer");
    GetPlayerName(playerid, name, sizeof name);
    format(form,sizeof form,"***INFO:%s ist nun Dealer",name);
    SendClientMessage(playerid,COLOR_BLUE,form);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED,"Diesen Job gibt es nicht!");
    SendClientMessage(playerid,COLOR_BLUE,"Jobs: Taxifahrer , Dealer , Arzt ");
    return 1;
    }
    return 0;
    }

    Gruß Nate

  • Du brauchst den dcmd und den sscanf Code und du musst die Farbe Gelb definieren.
    Aufgrund deiner knapp 250 Posts ging ich davon aus,dass du soetwas wüsstest :rolleyes: :rolleyes: ^^ .

    Suche Scriptlehrer :rolleyes: