Beiträge von BlackFoX

    Die Variable die das Team des Spielers wiedergibt, Switch ist ein sogenanntes Schubladen System & führt diejenige Schublade/case aus welche den Inhalt im Kop enthält der im Kopf von Switch vorhanden ist

    Entweder es ist wieder einer der Server die mit dem Amx Emulator laufen & dazu noch nen GF was absoluter Schwachsinn ist da Sa-mp, Sa-mp bleibt & niemals an MTA heranreichen wird
    oder er hat wirklich in den Falschen Bereich geschrieben, sieht mir nach 0815 aus entweder Moderntopia oder ein weiterer GF Edit

    if(!strcmp(cmdtext,"/sniper",true))
    {
    switch(<teamid>) // variable für Spieler Team nachtragen
    {
    case 0: /* team 0 */
    {
    GivePlayerWeapon...
    }
    }
    return 1;
    }

    Kein Wunder wenn die Klasse für das Kommando fehlt, schau mal unter Sa-mp > Tutorials , Goldkiller hat dort ein sehr gutes Tutorial für dcmd geschrieben

    Aus Langeweile entstanden


    StrCmp(const str0[],const str1[],maxln = 0)
    {
    new jcount;
    maxln = (!maxln) ? (strlen(str1)) : (maxln);
    while(str0[jcount]==str1[jcount] && str0[jcount])jcount++;
    return (jcount==maxln) ? (1) : (0);
    }

    • Vergleicht 2 Texte miteinander


    StrCpy(str0[],const str1[])
    {
    new jpos;
    str0[0] = '\0';
    while(str0[jpos])
    {
    str1[jpos] = str0[jpos];
    jpos++;
    }
    }

    • Kopiert den Text


    Spiegeln(str0[],const str1[])
    {
    new jpos = strlen(str1),nn;
    while(jpos>0)
    {
    str0[nn] = str1[jpos];
    jpos--;
    nn++;
    }
    }

    • Gibt den Text gespiegelt wieder


    StrLen(const str[])
    {
    new ppos;
    while(str[ppos])ppos++;
    return ppos;
    }

    • Gibt die Länge eines Textes wieder

    if(strcmp(cmd, "/auto", true)==0)
    {
    if(Account[playerid][Admin] == 3)
    {
    new modelid,respawn,count;
    new Float:isx,Float:isy,Float:isz;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_WHITE, "Benutze: /auto [modelid] [Respawn Time]");
    return 1;
    }
    modelid = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_WHITE, "Benutze: /auto [modelid] [Respawn Time]");
    return 1;
    }
    respawn = strval(tmp);
    SCM(playerid,COLOR_GREEN,"/////////////////////////////////////////////////");
    SCM(playerid,COLOR_LIGHTRED," Auto erstellt ");
    SCM(playerid,COLOR_GREEN,"/////////////////////////////////////////////////");
    GPP(playerid,Float:isx,Float:isy,Float:isz);
    CreateVehicle(modelid,isx,isy,isz,0,0,0,respawn);
    while(count<MAX_VEHICLES && !CreateINI(string)){format(string, sizeof(string),"Autos/vehicle_%d.sav",count);count++;}
    format(string, sizeof(string),"Autos/vehicle_%d.sav",count);
    if(count==MAX_VEHICLES && fexist(string))return 1;
    Autos[count][vModel] = modelid;
    Autos[count][vEingepackt] = 0;
    Autos[count][vArt] = 0;
    Autos[count][vX] = isx;
    Autos[count][vY] = isy;
    Autos[count][vZ] = isz;
    Autos[count][vA] = 0;
    Autos[count][vFarbe1] = 0;
    Autos[count][vFarbe2] = 0;
    Autos[count][vVerkauf] = 0;
    Autos[count][vPreis] = 0;
    Autos[count][vKMStand] = 0;
    Autos[count][vRKMStand] = 0;
    strmid(Autos[count][vBesitzer], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch1], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch2], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch3], "Niemand", 0, strlen("Niemand"), 255);
    Autos[count][vBeschlagnahmt] = 0;
    Autos[count][vBX] = isx;
    Autos[count][vBY] = isy;
    Autos[count][vBZ] = isz;
    Autos[count][vBA] = 0;
    Autos[count][vRespawn] = respawn;
    OnVehicleDataUpdate(count);
    }
    else
    {
    SCM(playerid, COLOR_RED, "Du bist kein Admin!");
    return 1;
    }
    return 1;
    }

    Versuchs jetzt mal

    Du willst die Spieler Energie also auf die Variable+Deinen Wert setzen ? aber in der Variable existiert nur ein Null Wert was
    schon mal dran gedacht das Set = Setzen bedeutet & du den Wert erst abfragen musst bzw. in die Variable zurückgeben ...

    if(strcmp(cmd, "/auto", true)==0)
    {
    if(Account[playerid][Admin] == 3)
    {
    new modelid,respawn,count;
    new Float:isx,Float:isy,Float:isz;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_WHITE, "Benutze: /auto [modelid] [Respawn Time]");
    return 1;
    }
    modelid = strval(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SCM(playerid, COLOR_WHITE, "Benutze: /auto [modelid] [Respawn Time]");
    return 1;
    }
    respawn = strval(tmp);
    SCM(playerid,COLOR_GREEN,"/////////////////////////////////////////////////");
    SCM(playerid,COLOR_LIGHTRED," Auto erstellt ");
    SCM(playerid,COLOR_GREEN,"/////////////////////////////////////////////////");
    GPP(playerid,Float:isx,Float:isy,Float:isz);
    CreateVehicle(modelid,isx,isy,isz,0,0,0,respawn);
    while(count<MAX_VEHICLES && !CreateINI(string)){format(string, sizeof(string),"Autos/vehicle_%d.sav",count);count++;}
    if(count==MAX_VEHICLES && fexist(string))return 1;
    Autos[count][vModel] = modelid;
    Autos[count][vEingepackt] = 0;
    Autos[count][vArt] = 0;
    Autos[count][vX] = isx;
    Autos[count][vY] = isy;
    Autos[count][vZ] = isz;
    Autos[count][vA] = 0;
    Autos[count][vFarbe1] = 0;
    Autos[count][vFarbe2] = 0;
    Autos[count][vVerkauf] = 0;
    Autos[count][vPreis] = 0;
    Autos[count][vKMStand] = 0;
    Autos[count][vRKMStand] = 0;
    strmid(Autos[count][vBesitzer], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch1], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch2], "Niemand", 0, strlen("Niemand"), 255);
    strmid(Autos[count][vSch3], "Niemand", 0, strlen("Niemand"), 255);
    Autos[count][vBeschlagnahmt] = 0;
    Autos[count][vBX] = isx;
    Autos[count][vBY] = isy;
    Autos[count][vBZ] = isz;
    Autos[count][vBA] = 0;
    Autos[count][vRespawn] = respawn;
    OnVehicleDataUpdate(count);
    }
    else
    {
    SCM(playerid, COLOR_RED, "Du bist kein Admin!");
    return 1;
    }
    return 1;
    }