Hi wie kann ich das einfügen??

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
  • Wie soll ich das einfügen?? wenn ich das einfüge wie es da steht kommen errors xD





    // Top of your script
    #define MAX_ROADBLOCKS 85 // Can be anything you want, but don't go over the top.
    // Search enum in your script and add this:
    enum rInfo
    {
    sCreated,
    Float:sX,
    Float:sY,
    Float:sZ,
    sObject,
    };
    new Roadblocks[MAX_ROADBLOCKS][rInfo];
    // Place this under OnPlayerCommandText
    if(strcmp(cmd, "/nappel", true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
    SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Cone");
    return 1;
    }
    new rb = strval(tmp);
    if (rb == 1)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1459,plocx,plocy,plocz,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 2)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 3)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
    SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 5)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 6)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrb",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    DeleteClosestRoadblock(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrball",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    if(PlayerInfo[playerid][pRank] >= 6 || IsPlayerAdmin(playerid)) // This being the default Chief rank in LA-RP change if neccesary.
    {
    DeleteAllRoadblocks(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
    }
    }
    return 1;
    }
    // Place this under your script
    stock CreateRoadblock(Object,Float:x,Float:y,Float:z,Float:Angle)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(Roadblocks[i][sCreated] == 0)
    {
    Roadblocks[i][sCreated] = 1;
    Roadblocks[i][sX] = x;
    Roadblocks[i][sY] = y;
    Roadblocks[i][sZ] = z-0.7;
    Roadblocks[i][sObject] = CreateDynamicObject(Object, x, y, z-0.9, 0, 0, Angle);
    return 1;
    }
    }
    return 0;
    }
    stock DeleteAllRoadblocks(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 100, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
    {
    if(Roadblocks[i][sCreated] == 1)
    {
    Roadblocks[i][sCreated] = 0;
    Roadblocks[i][sX] = 0.0;
    Roadblocks[i][sY] = 0.0;
    Roadblocks[i][sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[i][sObject]);
    }
    }
    }
    return 0;
    }
    stock DeleteClosestRoadblock(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
    {
    if(Roadblocks[i][sCreated] == 1)
    {
    Roadblocks[i][sCreated] = 0;
    Roadblocks[i][sX] = 0.0;
    Roadblocks[i][sY] = 0.0;
    Roadblocks[i][sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[i][sObject]);
    return 1;
    }
    }
    }
    return 0;
    }

  • scheint mit audio plugin zu sein, haste das denn?


    _____________________________________________________________________________________________________________________________________________
    Die Anwort auf ALLES
    x = 9 * 6
    x = 3 * 3 * 2 * 3 = 42 (heißt auch das eigentlich alles 42 "returnt" [return 42;])
    Definitionsmenge = [0;42]
    ==> Lösungsmenge = {}


    Daraus Folgt: Das Leben macht keinen Sinn .
    Details siehe Reiseführer "Per Anhalter durch die Galaxis".


  • ja ich benutze gerade ein LOH GF das wir gerade umscripten also die cars von den frakas undso

  • Ganz oben im Script zu den ganzen New´s und Definitionen
    #define MAX_ROADBLOCKS 85 // Can be anything you want, but don't go over the top.
    // Search enum in your script and add this:
    enum rInfo
    {
    sCreated,
    Float:sX,
    Float:sY,
    Float:sZ,
    sObject,
    };
    new Roadblocks[MAX_ROADBLOCKS][rInfo];


    unter OnPlayerCommandText


    if(strcmp(cmd, "/nappel", true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
    SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Cone");
    return 1;
    }
    new rb = strval(tmp);
    if (rb == 1)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1459,plocx,plocy,plocz,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 2)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 3)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
    SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 5)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 6)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrb",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    DeleteClosestRoadblock(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrball",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    if(PlayerInfo[playerid][pRank] >= 6 || IsPlayerAdmin(playerid)) // This being the default Chief rank in LA-RP change if neccesary.
    {
    DeleteAllRoadblocks(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
    }
    }
    return 1;
    }


    und ganz unten ins Script


    stock CreateRoadblock(Object,Float:x,Float:y,Float:z,Float:Angle)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(Roadblocks[i][sCreated] == 0)
    {
    Roadblocks[i][sCreated] = 1;
    Roadblocks[i][sX] = x;
    Roadblocks[i][sY] = y;
    Roadblocks[i][sZ] = z-0.7;
    Roadblocks[i][sObject] = CreateDynamicObject(Object, x, y, z-0.9, 0, 0, Angle);
    return 1;
    }
    }
    return 0;
    }
    stock DeleteAllRoadblocks(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 100, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
    {
    if(Roadblocks[i][sCreated] == 1)
    {
    Roadblocks[i][sCreated] = 0;
    Roadblocks[i][sX] = 0.0;
    Roadblocks[i][sY] = 0.0;
    Roadblocks[i][sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[i][sObject]);
    }
    }
    }
    return 0;
    }
    stock DeleteClosestRoadblock(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
    {
    if(Roadblocks[i][sCreated] == 1)
    {
    Roadblocks[i][sCreated] = 0;
    Roadblocks[i][sX] = 0.0;
    Roadblocks[i][sY] = 0.0;
    Roadblocks[i][sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[i][sObject]);
    return 1;
    }
    }
    }
    return 0;
    }





    PS: Steht aber alles dort im Code ^^

  • Oben im Script noch folgendes einfügen:
    new GPN[MAX_PLAYERS];
    Und den Befehl (die Stock's etc. nicht !) in folgendes ändern:
    if(strcmp(cmd, "/nappel", true) == 0)
    {
    GetPlayerName(playerid,GPN[playerid],sizeof(GPN));
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {


    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {


    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
    SendClientMessage(playerid, COLOR_YELLOW, "Available Roadblocks:");
    SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Cone");
    return 1;
    }


    new rb = strval(tmp);
    if (rb == 1)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1459,plocx,plocy,plocz,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }


    else if (rb == 2)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }


    else if (rb == 3)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
    SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
    return 1;
    }


    else if (rb == 4)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
    return 1;
    }


    else if (rb == 4)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }


    else if (rb == 5)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }


    else if (rb == 6)
    {


    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }


    }
    return 1;
    }
    else if (strcmp(cmd,"/rrb",true) == 0)
    {


    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {


    DeleteClosestRoadblock(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
    }


    return 1;
    }


    else if (strcmp(cmd,"/rrball",true) == 0)
    {


    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {


    if(PlayerInfo[playerid][pRank] >= 6 || IsPlayerAdmin(playerid)) // This being the default Chief rank in LA-RP change if neccesary.
    {


    DeleteAllRoadblocks(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",GPN[playerid]);
    SendRadioMessage(1,COLOR_YELLOW,string);
    GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
    }


    }


    return 1;
    }

    Ansonsten alles machen, wie es dort steht.


    So kommen bei mir keine Error's / Warning's mehr.
    Habs getestet und klappt ohne Probleme. ;)


    MfG, Piranha.


    //Edit: Was hinzugefügt.

  • d-.-b


    ´


    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14673) : error 017: undefined symbol "cmd"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14679) : error 017: undefined symbol "tmp"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14679) : error 017: undefined symbol "idx"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14680) : error 017: undefined symbol "tmp"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14692) : error 017: undefined symbol "tmp"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14701) : error 017: undefined symbol "string"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14701) : error 017: undefined symbol "string"
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14701) : error 029: invalid expression, assumed zero
    C:\Users\SuB_Z3r0\Desktop\Server\gamemodes\gfl.pwn(14701) : fatal error 107: too many error messages on one line

  • Der zweite Code muss bei OnPlayerCommandText rein ;)

    dcmd_greenpeace(playerid,params[]) {
    #pragma unused params
    SendClientMessage(playerid, Grün, "Rettet die Wale,esst mehr Bieber!");
    return 1;
    }


    Mapplanung:
    Etwas einzigartiges was noch kein anderer veröffentlicht hat.
    70% fertig.

  • Also so hab ichs gemacht:




    Das bei den Defines


    #define MAX_ROADBLOCKS 85




    Das bei den andern enum's


    enum rInfo
    {
    sCreated,
    Float:sX,
    Float:sY,
    Float:sZ,
    sObject,
    };
    new Roadblocks[MAX_ROADBLOCKS][rInfo];








    Das bei OnPlayerCommandText


    if(strcmp(cmd, "/nappel", true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
    SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock");
    SendClientMessage(playerid, COLOR_GRAD1, "| 3: Cone");
    return 1;
    }
    new rb = strval(tmp);
    if (rb == 1)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1459,plocx,plocy,plocz,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 2)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
    return 1;
    }
    else if (rb == 3)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
    SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 4)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 5)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    else if (rb == 6)
    {
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
    format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
    return 1;
    }
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrb",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    DeleteClosestRoadblock(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
    }
    return 1;
    }
    else if (strcmp(cmd,"/rrball",true) == 0)
    {
    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
    {
    if(PlayerInfo[playerid][pRank] >= 6 || IsPlayerAdmin(playerid)) // This being the default Chief rank in LA-RP change if neccesary.
    {
    DeleteAllRoadblocks(playerid);
    format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",GPN(playerid));
    SendRadioMessage(1,COLOR_BLUE,string);
    GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
    }
    }
    return 1;
    }





    und das unten ganz einfach dran gehangen:




    stock CreateRoadblock(Object,Float:x,Float:y,Float:z,Float:Angle)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(Roadblocks[sCreated] == 0)
    {
    Roadblocks[sCreated] = 1;
    Roadblocks[sX] = x;
    Roadblocks[sY] = y;
    Roadblocks[sZ] = z-0.7;
    Roadblocks[sObject] = CreateDynamicObject(Object, x, y, z-0.9, 0, 0, Angle);
    return 1;
    }
    }
    return 0;
    }


    stock DeleteAllRoadblocks(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 100, Roadblocks[sX], Roadblocks[sY], Roadblocks[sZ]))
    {
    if(Roadblocks[sCreated] == 1)
    {
    Roadblocks[sCreated] = 0;
    Roadblocks[sX] = 0.0;
    Roadblocks[sY] = 0.0;
    Roadblocks[sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[sObject]);
    }
    }
    }
    return 0;
    }


    stock DeleteClosestRoadblock(playerid)
    {
    for(new i = 0; i < sizeof(Roadblocks); i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[sX], Roadblocks[sY], Roadblocks[sZ]))
    {
    if(Roadblocks[sCreated] == 1)
    {
    Roadblocks[sCreated] = 0;
    Roadblocks[sX] = 0.0;
    Roadblocks[sY] = 0.0;
    Roadblocks[sZ] = 0.0;
    DestroyDynamicObject(Roadblocks[sObject]);
    return 1;
    }
    }
    }
    return 0;
    }


    was ist daran falsch?

    Einmal editiert, zuletzt von _ViRuS_ ()

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • doch is alles richtig aber ist nun egal, ich denke mal das liegt daran das schon eins vorhanden war, danke an alle dir mir geholfen haben.



    //Close :!:



    MfG.