Beiträge von Zaziki

    Hallo,


    Immer wenn ich meinen 2. Bildschirm an meinem PC schließe und ich dann erstmal ingame gehe geht auch alles. Dann aber wenn ein Auto explodiert crasht mein Game mit diesem Code:

    Wenn ich dann aber nur einen BIldschirm anschließe läuft es problemlos, aber was kann ich dafür tun das ich auch mit 2 BIldschirmen noch SAMP spielen kann? Ich habe keine Lust immer einen abzunehmen...

    Also ich habs im Moment so:



    if (strcmp("/gibmirdasgeld", cmdtext, true, 8) ==0)
    {
    new vehicleid = GetPlayerVehicleID(playerid);


    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1228.791870, -2854.440186, 12.996049))


    if(vehicleid == 403)
    {
    GivePlayerMoney(playerid,500);
    }


    return 1;
    }


    Doch auch wenn ich da bin, bekomme ich kein Geld ?(

    Also meine Posts waren ein bißchen ungenau ^^


    1. Wenn man das erste mal auf dem Server connectet, muss man sich ein Account anlegen
    2. Dann einmal einen Skin auswählen, das mann mit gTeam z.B. im Team Ballas ist
    3. Wenn man sich auslogt das das Geld, die Tode, die Kills und den Skin speichert
    4. Wenn man dann das nächstemal connectet /login [Passwort] machen muss und wenn man das gemacht hat man sein Geld, Kills, Tode und den Skin bekommt mitdem man sich ausgelogt hat.



    Hoffe das war jetzt besser erklärt.

    Also ich habe ein Registersystem gedownloadet von Joaum.


    Spoiler anzeigen

    /*
    Register FilterScript By Joaum
    */

    Spoiler anzeigen
    #include <a_samp>
    #include <dutils>//you need this include
    #include <dudb>//this too

    Spoiler anzeigen
    #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
    #define COLOR_SYSTEM 0xEFEFF7AA
    #define MAX_TRIES 3 // Tries number before kick the player
    #define COLOR_RED 0xFF0000FF //RED
    new PLAYERLIST_authed[MAX_PLAYERS];
    new pkills[MAX_PLAYERS];
    new pdeaths[MAX_PLAYERS];
    new tries[MAX_PLAYERS];

    Spoiler anzeigen
    public OnFilterScriptInit()
    {
    printf(" ________________________ ");
    printf(" ");
    printf(" ");
    printf(" Register-System geladen! ");
    printf(" ");
    printf(" ");
    printf(" ________________________ ");

    Spoiler anzeigen
    }
    stock SystemMsg(playerid,msg[]) {
    if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) {
    SendClientMessage(playerid,COLOR_SYSTEM,msg);
    }
    return 1;
    }

    Spoiler anzeigen
    stock PlayerName(playerid) {
    new name[255];
    GetPlayerName(playerid, name, 255);
    return name;
    }

    Spoiler anzeigen
    dcmd_register(playerid,params[]) {

    Spoiler anzeigen
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Du bist bereits eingelogt.");

    Spoiler anzeigen
    if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Dieser Account existiert bereits, benutze /login [Passwort].");

    Spoiler anzeigen
    if (strlen(params)==0) return SystemMsg(playerid,"Richtige Benutzung: /register [Passwort]");

    Spoiler anzeigen
    if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account erstellt! Benutzt jetzt /login [Passwort]");
    return true;

    Spoiler anzeigen
    }

    dcmd_login(playerid,params[]) {

    Spoiler anzeigen
    if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Du bist bereits eingelogt.");
    if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Dein Account existiert nicht! Benutze /register [Passwort]");
    if (strlen(params)==0) return SystemMsg(playerid,"Richtige Benutzung: /login [Passwort]");

    Spoiler anzeigen
    if (udb_CheckLogin(PlayerName(playerid),params)) {
    // Status
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("Geld")+GetPlayerMoney(playerid));
    SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("Score")+GetPlayerScore(playerid));
    pkills[playerid] = (playerid,dUserINT(PlayerName(playerid)).("Kills")+pkills[playerid]);
    pdeaths[playerid] = (playerid,dUserINT(PlayerName(playerid)).("Tode")+pdeaths[playerid]);
    PLAYERLIST_authed[playerid]=true;

    Spoiler anzeigen
    return SystemMsg(playerid,"Erfolgreich eingelogt! Viel Spaß!");
    }
    // Bad Password
    tries[playerid]++;
    if(tries[playerid] == MAX_TRIES) {
    SystemMsg(playerid,"Du wurdest gekickt weil du zuoft das Passwort falsch eingegeben hast!");
    print("The Player was kicked for didnt put the password correctly");//lets print this to warn the server
    Kick(playerid);
    }
    else if (tries[playerid] == MAX_TRIES-1){
    SendClientMessage(playerid, COLOR_RED, "Beim nächsten falschen Versuch wirst du gekickt!");//ouch..
    }
    return 0;
    }

    public OnPlayerCommandText(playerid,cmdtext[]) {
    dcmd(login,5,cmdtext);
    dcmd(register,8,cmdtext);

    if(strcmp(cmdtext, "/stats", true) == 0)
    {
    new stringkills[256];
    new stringmortes[256];
    new stringratio[256];
    new stringscore[256];
    new stringdinheiro[256];
    new Float:ratio=floatdiv(pkills[playerid],pdeaths[playerid]);
    format(stringkills,sizeof(stringkills), "Kills: %d",pkills[playerid]);
    format(stringmortes,sizeof(stringmortes), "Tode: %d",pdeaths[playerid]);
    format(stringratio,sizeof(stringratio), "Ratio: %.2f",ratio);
    format(stringdinheiro,sizeof(stringdinheiro), "Geld: %d",GetPlayerMoney(playerid));
    format(stringscore,sizeof(stringscore), "Score: %d",GetPlayerScore(playerid));
    SendClientMessage(playerid, 0xFFFF00AA, " ");
    SendClientMessage(playerid, 0xFFFF00AA, "Deine Statistiken:");
    SendClientMessage(playerid, 0xFFFF00AA, stringkills);
    SendClientMessage(playerid, 0xFFFF00AA, stringmortes);
    SendClientMessage(playerid, 0xFFFF00AA, stringratio);
    SendClientMessage(playerid, 0xFFFF00AA, stringscore);
    SendClientMessage(playerid, 0xFFFF00AA, stringdinheiro);
    SendClientMessage(playerid, 0xFFFF00AA, " ");
    return 1;
    }

    Spoiler anzeigen
    return false;
    }

    Spoiler anzeigen
    public OnPlayerRequestSpawn(playerid)
    {
    if (!PLAYERLIST_authed[playerid]){
    if (udb_Exists(PlayerName(playerid))) {
    SendClientMessage(playerid, COLOR_SYSTEM, "------------------------------------------");
    SendClientMessage(playerid, COLOR_SYSTEM, "| |");
    SendClientMessage(playerid, COLOR_SYSTEM, "Benutze /login [Passwort] um dich einzuloggen! ");
    SendClientMessage(playerid, COLOR_SYSTEM, "| |");
    SendClientMessage(playerid, COLOR_SYSTEM, "------------------------------------------");
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    PlayerPlaySound(playerid,1147, X, Y, Z);//music
    return 0;
    }
    else SendClientMessage(playerid, COLOR_SYSTEM, "Du kannst jetzt spielen.");
    }
    return 1;
    }

    Spoiler anzeigen
    public OnPlayerText(playerid, text[])
    { if (!PLAYERLIST_authed[playerid]){
    if (udb_Exists(PlayerName(playerid))){
    SystemMsg(playerid,"Du musst dich erst einloggen um den Chat zu benutzen!");
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    PlayerPlaySound(playerid,1147, X, Y, Z);//music
    }
    return 0;
    }
    return 1;
    }

    Spoiler anzeigen
    public OnPlayerDeath(playerid, killerid, reason)

    Spoiler anzeigen
    if (killerid != INVALID_PLAYER_ID) {

    Spoiler anzeigen
    pkills[killerid] ++;
    pdeaths[playerid] ++;
    }

    Spoiler anzeigen
    return 1;

    Spoiler anzeigen
    public OnPlayerConnect(playerid) {
    tries[playerid] = 0;
    PLAYERLIST_authed[playerid]=false;
    if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, COLOR_SYSTEM, "Wilkommen zurück! Du bist bereits registriert (/login password)");
    return false;

    Spoiler anzeigen
    public OnPlayerDisconnect(playerid) {
    if (PLAYERLIST_authed[playerid]) {
    // save
    dUserSetINT(PlayerName(playerid)).("Geld",GetPlayerMoney(playerid));
    dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));
    dUserSetINT(PlayerName(playerid)).("Kills",pkills[playerid]);
    dUserSetINT(PlayerName(playerid)).("Tode",pdeaths[playerid]);
    }
    PLAYERLIST_authed[playerid]=false;
    return false;
    }


    Habe es nur auf Deutsch übersetzt

    Was hast du für ein Adminsystem oder auch was für ein Gamemode benutzt du?


    Am besten mal aus dem Script den /veh Teil posten.

    Man könnte es so machen:


    /auf:

    if(strcmp("/auf",cmdtext,true) == 0)
    {
    if(PlayerToPoint(20.0,playerid,287.078949, -1809.406250, 4.111876)) //Wenn der Spieler in der Nähe ist dann:
    {
    if(gTeam[playerid] == TEAMNAME)//Wenn der Spieler im richtigen Team ist:
    {
    MoveObject(GATE 1 ZU, 287.078949, -1809.406250, 4.111876,3);//Damit wird das Gate auf die gewünschte Position gerückt
    }
    }
    if(PlayerToPoint(20.0,playerid,305.412018, -1864.877441, 9.568738))
    {
    if(gTeam[playerid] == TEAMNAME)
    {
    MoveObject(GATE 2 ZU , 305.412018, -1864.877441, 9.568738,3);
    }
    }



    return 1;
    }

    Ungetestet!



    So kann man natürlich noch einen /zu Command erstellen oder auch Timer setzen damit die Tore automatisch zu gehen^^

    Ich schätze mal du willst einen DM Server machen? :P




    gTeam (Nach oben):


    static gTeam[MAX_PLAYERS];
    #define TEAM_GROVE 0
    #define TEAM_BALLAS 1
    #define TEAM_COP 2
    #define TEAM_TRIADEN 3
    #define TEAM_HITMAN 4


    AddPlayerClass (Bei OnGameModeInit):



    AddPlayerClass(102,2002.9896,-1115.7136,27.1250,92.0379,0,0,0,0,0,0); // Ballas Spawn
    AddPlayerClass(103,2002.9896,-1115.7136,27.1250,92.0379,0,0,0,0,0,0); // Ballas Spawn
    AddPlayerClass(104,2002.9896,-1115.7136,27.1250,92.0379,0,0,0,0,0,0); // Ballas Spawn
    AddPlayerClass(105,2459.6799,-1690.5546,13.5416,352.9616,0,0,0,0,0,0); // Grove
    AddPlayerClass(106,2522.0486,-1679.1824,15.4970,72.5490,0,0,0,0,0,0); // Grove
    AddPlayerClass(107,2495.4314,-1686.7506,13.5150,356.5232,0,0,0,0,0,0); // Grove
    AddPlayerClass(280,1568.6503,-1693.7280,5.8906,177.1730,0,0,0,0,0,0); //cop
    AddPlayerClass(281,1568.6503,-1693.7280,5.8906,177.1730,0,0,0,0,0,0); //cop
    AddPlayerClass(284,1568.6503,-1693.7280,5.8906,177.1730,0,0,0,0,0,0); //cop
    AddPlayerClass(117,848.4336,-1197.8033,16.9766,357.6465,0,0,0,0,0,0); // Triadenspawn
    AddPlayerClass(118,848.4336,-1197.8033,16.9766,357.6465,0,0,0,0,0,0); // Triadenspawn
    AddPlayerClass(120,848.4336,-1197.8033,16.9766,357.6465,0,0,0,0,0,0); // Triadenspawn
    AddPlayerClass(121,742.7863,-1357.1238,13.5000,311.5738,0,0,0,0,0,0); //Hitmanspawn
    AddPlayerClass(112,742.7863,-1357.1238,13.5000,311.5738,0,0,0,0,0,0); //Hitmanspawn
    AddPlayerClass(113,742.7863,-1357.1238,13.5000,311.5738,0,0,0,0,0,0); //Hitmanspawn


    OnPlayerRequestClass:


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1960.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    if(classid == 0)
    {
    gTeam[playerid] = TEAM_BALLAS;
    GameTextForPlayer(playerid, "~g~BALLAS", 500, 3);
    }
    if(classid == 1)
    {
    gTeam[playerid] = TEAM_BALLAS;
    GameTextForPlayer(playerid, "~g~BALLAS", 500, 3);
    }
    if(classid == 2)
    {
    gTeam[playerid] = TEAM_BALLAS;
    GameTextForPlayer(playerid, "~g~BALLAS", 500, 3);
    }
    if(classid == 3)
    {
    gTeam[playerid] = TEAM_GROVE;
    GameTextForPlayer(playerid, "~g~GROVE", 500, 3);
    }
    if(classid == 4)
    {
    gTeam[playerid] = TEAM_GROVE;
    GameTextForPlayer(playerid, "~g~GROVE", 500, 3);
    }
    if(classid == 5)
    {
    gTeam[playerid] = TEAM_GROVE;
    GameTextForPlayer(playerid, "~g~GROVE", 500, 3);
    }
    if(classid == 6)
    {
    gTeam[playerid] = TEAM_COP;
    GameTextForPlayer(playerid, "~g~COP", 500, 3);
    }
    if(classid == 7)
    {
    gTeam[playerid] = TEAM_COP;
    GameTextForPlayer(playerid, "~g~COP", 500, 3);
    }
    if(classid == 8)
    {
    gTeam[playerid] = TEAM_COP;
    GameTextForPlayer(playerid, "~g~COP", 500, 3);
    }
    if(classid == 9)
    {
    gTeam[playerid] = TEAM_TRIADEN;
    GameTextForPlayer(playerid, "~g~Triade", 500, 3);
    }
    if(classid == 10)
    {
    gTeam[playerid] = TEAM_TRIADEN;
    GameTextForPlayer(playerid, "~g~Triade", 500, 3);
    }
    if(classid == 11)
    {
    gTeam[playerid] = TEAM_TRIADEN;
    GameTextForPlayer(playerid, "~g~Triade", 500, 3);
    }
    if(classid == 12)
    {
    gTeam[playerid] = TEAM_HITMAN;
    GameTextForPlayer(playerid, "~g~Hitman", 500, 3);
    }
    if(classid == 13)
    {
    gTeam[playerid] = TEAM_HITMAN;
    GameTextForPlayer(playerid, "~g~Hitman", 500, 3);
    }
    if(classid == 14)
    {
    gTeam[playerid] = TEAM_HITMAN;
    GameTextForPlayer(playerid, "~g~Hitman", 500, 3);
    }


    return 1;
    }



    OnPlayerSpawn:


    public OnPlayerSpawn(playerid)
    {
    if(gTeam[playerid] == TEAM_GROVE)
    {


    SetPlayerColor(playerid, 0x009200FF);
    GivePlayerWeapon(playerid, 28, 500);//Uzi
    GivePlayerWeapon(playerid, 25, 50);//shotgun
    GivePlayerWeapon(playerid, 24, 150);//deagle
    }
    if(gTeam[playerid] == TEAM_BALLAS)
    {


    SetPlayerColor(playerid, 0xFF00FFFF);
    GivePlayerWeapon(playerid, 28, 500);//Uzi
    GivePlayerWeapon(playerid, 25, 50);//shotgun
    GivePlayerWeapon(playerid, 24, 150);//deagle


    }
    if(gTeam[playerid] == TEAM_COP)
    {


    SetPlayerColor(playerid, 0x00F6F6F6);


    }
    if(gTeam[playerid] == TEAM_TRIADEN)
    {


    SetPlayerColor(playerid, 0xFF66FFAA);
    GivePlayerWeapon(playerid, 5, 1);//Baseballschläger
    GivePlayerWeapon(playerid, 30, 500);//Uzi
    GivePlayerWeapon(playerid, 34, 50);//Sniper
    GivePlayerWeapon(playerid, 24, 50);//Deagle
    }
    if(gTeam[playerid] == TEAM_HITMAN)
    {


    SetPlayerColor(playerid, 0xAFAFAFAA);
    GivePlayerWeapon(playerid, 5, 1);//Baseballschläger
    GivePlayerWeapon(playerid, 30, 500);//Uzi
    GivePlayerWeapon(playerid, 34, 50);//Sniper
    GivePlayerWeapon(playerid, 24, 50);//Deagle
    }
    return 1;
    }


    Ist alles nur ein Beispiel ;)

    Cool danke!


    Jetzt hatte ich ein paat Fehler, habe alle bis auf 2 beheben können:

    Zitat


    C:\Games\ALLESA~1\AKTUEL~1.(AN\GAMEMO~1\Reallife.pwn(1201) : warning 219: local variable "ID" shadows a variable at a preceding level
    C:\Games\ALLESA~1\AKTUEL~1.(AN\GAMEMO~1\Reallife.pwn(1218) : warning 219: local variable "ID" shadows a variable at a preceding level
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Warnings.


    Zeile 1201: new ID = strval(tmp);


    1218: new ID = strval(tmp);

    Hi,


    Ich wollte fragen wie ich die Commands /suspect (Wanteds geben) und /clear (Wanteds löschen) machen kann.
    Ich habe bereits gesucht aber nichts passendes gefunden. Am besten wäre es dann noch wenn die Wanteds gespeichert werden und beim nächsten Login wieder da sind :)


    Ich habe ein selfmade, kein Godfather!



    Danke im Vorraus.
    MfG Zaziki