bite um hilfe bei meinen problem im script

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
  • J:\spiele\gta-sa\gamemodes\blanko.pwn(526) : error 006: must be assigned to an array
    J:\spiele\gta-sa\gamemodes\blanko.pwn(527) : error 035: argument type mismatch (argument 1)
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 012: invalid function call, not a valid address
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : warning 215: expression has no effect
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 001: expected token: ";", but found ")"
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 029: invalid expression, assumed zero
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.



    if(strcmp(cmd, "/sethp", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx); //zeile 526
    if(!strlen(tmp)) //zeile 527
    {
    SendClientMessage(playerid, rot, "Benutze /sethp id hp");
    return 1;
    }
    new playa;
    new health;
    playa = ReturnUser(tmp); //zeile 534
    tmp = strtok(cmdtext, idx);
    health = strval(tmp);
    if (PlayerInfo[playerid][padmlvl] >= 4)
    {
    if(IsPlayerConnected(playa))
    {
    if(playa != INVALID_PLAYER_ID)
    {
    SetPlayerHealth(playa, health);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt, diesen Befehl zu benutzen!");
    }
    }
    return 1;
    }


    Was habe ich hier falsch gemacht ich hoffe ihr könnt mir helfen

  • Versuch das mal
    if(strcmp(cmd, "/sethp", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze /sethp ID HP");
    return 1;
    }
    new playa;
    new health;
    playa = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    health = strval(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 4)
    {
    if(IsPlayerConnected(playa))
    {
    if(playa != INVALID_PLAYER_ID)
    {
    SetPlayerHealth(playa, health);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt , diesen Befehl zu benutzen!");
    }
    }
    return 1;
    }


    Powered by Windows 7


    Die HDD stimmt nich , hab 3 Festplatten drin.

  • J:\spiele\gta-sa\gamemodes\blanko.pwn(526) : error 006: must be assigned to an array
    J:\spiele\gta-sa\gamemodes\blanko.pwn(527) : error 035: argument type mismatch (argument 1)
    J:\spiele\gta-sa\gamemodes\blanko.pwn(529) : error 017: undefined symbol "COLOR_GRAD2"
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 012: invalid function call, not a valid address
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : warning 215: expression has no effect
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 001: expected token: ";", but found ")"
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 029: invalid expression, assumed zero
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    7 Errors.



    da kommts aufs selbe das mit die color das weis ich eh noch das ich die definieren muss aber bei denn rest keine ahnung



    edit: @ Bullet kannst du mir das bitte näher erklären ?

  • Mir ist grad aufgefallen , das du kein GF benutzt .
    Hast du schon strtok definiert ?
    mach das mal mit in script egal wo :D
    stock right(source[], len)
    {
    new retval[MAX_STRING], srclen;
    srclen = strlen(source);
    strmid(retval, source, srclen - len, srclen, MAX_STRING);
    return retval;
    }


    Powered by Windows 7


    Die HDD stimmt nich , hab 3 Festplatten drin.

  • #define COLOR_GRAD1 0xB4B5B7FF
    #define COLOR_GRAD2 0xBFC0C2FF
    #define COLOR_GRAD3 0xCBCCCEFF
    #define COLOR_GRAD4 0xD8D8D8FF
    #define COLOR_GRAD5 0xE3E3E3FF
    #define COLOR_GRAD6 0xF0F0F0FF
    #define COLOR_LIGHTRED 0xFF6347AA
    #define COLOR_GREY 0xAFAFAFAA
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    #define COLOR_YELLOW 0xFFFF00AA
    #define COLOR_WHITE 0xFFFFFFAA
    #define COLOR_DARKRED 0x660000AA
    #define COLOR_BLUE 0x0000BBAA
    #define COLOR_ORANGE 0xFF9900AA
    #define COLOR_PINK 0xFF66FFAA
    #define COLOR_LIGHTBLUE 0x33CCFFAA
    #define COLOR_CYAN 0x00BFF3AA
    #define COLOR_BLACK 0x000000AA
    #define COLOR_BROWN 0XA52A2AAA
    #define COLOR_GOLD 0xB8860BAA
    #define COLOR_INDIGO 0x4B00B0AA
    #define COLOR_LAWNGREEN 0x7CFC00AA
    #define COLOR_LIMEGREEN 0x32CD32AA
    #define COLOR_OLIVE 0x808000AA
    #define COLOR_SEAGREEN 0x2E8B57AA
    #define COLOR_TOMATO 0xFF6347AA
    #define COLOR_YELLOWGREEN 0x9ACD32AA
    #define COLOR_MEDIUMAQUA 0x83BFBFAA
    #define COLOR_FLBLUE 0x6495EDAA
    #define COLOR_MAGENTA 0xFF00FFFF
    #define COLOR_PURPLE 0x800080AA
    #define COLOR_GRELLRED 0xFF000000
    #define COLOR_LIGHTGREEN 0x86FF59FF
    #define COLOR_YELLOW2 0xF5DEB3AA

  • @ suggalike ja strtok habe ich schon definiert


    stock strget(strx[], pos, search = ' ') {
    new arg, ret[128], idxx;
    for (new i = 0; i < strlen(strx); i++) {
    if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
    arg++;
    if (arg == pos + 1){
    ret[i-idxx] = EOS;
    return ret;
    } else if (arg == pos)
    idxx= i+1;
    }
    else if (arg == pos)
    ret[i - idxx] = strx[i];
    }
    return ret;
    }
    stock strtok(const string[], &index,seperator=' ') {
    new length = strlen(string);
    new offset = index;
    new result[255];
    while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
    {
    result[index - offset] = string[index];
    index++;
    }


    result[index - offset] = EOS;
    if ((index < length) && (string[index] == seperator))
    {
    index++;
    }
    return result;
    }


    und strget auch :D

  • X( X( Suggalike, gibs zu, du hast KEINE Ahnung von dem was du postest X( X(


    @mi_pu:
    Zeig mal bitte wie du "tmp" definiert hast.

  • Jetzt schon danke ^^


    aber bekomme jetzt immer noch diese fehler^^
    J:\spiele\gta-sa\gamemodes\blanko.pwn(533) : error 006: must be assigned to an array
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 035: argument type mismatch (argument 1)
    J:\spiele\gta-sa\gamemodes\blanko.pwn(541) : error 012: invalid function call, not a valid address
    J:\spiele\gta-sa\gamemodes\blanko.pwn(541) : warning 215: expression has no effect
    J:\spiele\gta-sa\gamemodes\blanko.pwn(541) : error 001: expected token: ";", but found ")"
    J:\spiele\gta-sa\gamemodes\blanko.pwn(541) : error 029: invalid expression, assumed zero
    J:\spiele\gta-sa\gamemodes\blanko.pwn(541) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.



    um 1 error weniger


    Jetzt bin ich schon so weit in mein selfmade script und will es wegen denn blöden admin sys nicht aufgeben ;(
    irgendwie muss ich das ja schaffen

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • new ReturnUser;


    Fail...


    Du kannst ned einfach eine Variable erstellen wenn dir eine gleichnamige Funktion fehlt X(


    Hier hast die Funktion ReturnUser. Am besten fügst du sie ganz unten im Script ein.
    ReturnUser(text[], playerid = INVALID_PLAYER_ID)
    {
    new pos = 0;
    while (text[pos] < 0x21) // Strip out leading spaces
    {
    if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
    pos++;
    }
    new userid = INVALID_PLAYER_ID;
    if (IsNumeric(text[pos])) // Check whole passed string
    {
    // If they have a numeric name you have a problem (although names are checked on id failure)
    userid = strval(text[pos]);
    if (userid >=0 && userid < MAX_PLAYERS)
    {
    if(!IsPlayerConnected(userid))
    {
    /*if (playerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid, 0xFF0000AA, "User not connected");
    }*/
    userid = INVALID_PLAYER_ID;
    }
    else
    {
    return userid; // A player was found
    }
    }
    /*else
    {
    if (playerid != INVALID_PLAYER_ID)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Invalid user ID");
    }
    userid = INVALID_PLAYER_ID;
    }
    return userid;*/
    // Removed for fallthrough code
    }
    // They entered [part of] a name or the id search failed (check names just incase)
    new len = strlen(text[pos]);
    new count = 0;
    new name[MAX_PLAYER_NAME];
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerConnected(i))
    {
    GetPlayerName(i, name, sizeof (name));
    if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
    {
    if (len == strlen(name)) // Exact match
    {
    return i; // Return the exact player on an exact match
    // Otherwise if there are two players:
    // Me and MeYou any time you entered Me it would find both
    // And never be able to return just Me's id
    }
    else // Partial match
    {
    count++;
    userid = i;
    }
    }
    }
    }
    if (count != 1)
    {
    if (playerid != INVALID_PLAYER_ID)
    {
    if (count)
    {
    SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
    }
    else
    {
    SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
    }
    }
    userid = INVALID_PLAYER_ID;
    }
    return userid; // INVALID_USER_ID for bad return
    }

  • Also danke erstmal


    funkt leider trozdem noch nicht


    J:\spiele\gta-sa\gamemodes\blanko.pwn(462) : warning 219: local variable "ReturnUser" shadows a variable at a preceding level
    J:\spiele\gta-sa\gamemodes\blanko.pwn(534) : error 047: array sizes do not match, or destination array is too small
    J:\spiele\gta-sa\gamemodes\blanko.pwn(542) : error 012: invalid function call, not a valid address
    J:\spiele\gta-sa\gamemodes\blanko.pwn(542) : warning 215: expression has no effect
    J:\spiele\gta-sa\gamemodes\blanko.pwn(542) : error 001: expected token: ";", but found ")"
    J:\spiele\gta-sa\gamemodes\blanko.pwn(542) : error 029: invalid expression, assumed zero
    J:\spiele\gta-sa\gamemodes\blanko.pwn(542) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    5 Errors.



    ;(

  • J:\spiele\gta-sa\gamemodes\blanko.pwn(462) : warning 219: local variable "ReturnUser" shadows a variable at a preceding level


    Dadurch.