Roadblock

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
  • das untere haust du bei OnPlayerCommandText rein und das oberste versuch das ma bei OnGameModeInit, wenn es nciht klappen sollte dann mit in den script bei OnPlayerCommandText
    wenn beides end geht dann kA, glaub aber, dass mindestens 1 geht xD

  • Alsöö....



    new roadblock; // Unter includes
    new RoadBlock[MAX_PLAYERS]; // Unter includes



    public OnPlayerCommandText(playerid,cmdtext [])
    {
    if(strcmp(cmdtext, "/rb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
    SetPlayerPos(playerid, X, Y, Z+4);
    RoadBlock[playerid] += 1;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
    return 1;
    }
    if(strcmp(cmdtext, "/drb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    if (RoadBlock[playerid] == 0) return SendClientMessage(playerid, COLOR_RED," You didn't add a roadblock!");
    DestroyObject(roadblock);
    RoadBlock[playerid] -= 0;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Removed");
    return 1;
    }
    return 0;
    } //so in OnPlayerComandText einfügen


    Ich scripte NICHT mehr, ich möchte mit NIEMANDEM einen Server aufmachen habe auch NICHTS mehr mit LoH zu tun, also lasst es mit den PNs!

  • xD ich krig das net hin könnte mir mal jemand zeigen wo genau ich das bei
    public OnPlayerCommandText(playerid,cmdtext []) einfügen muss.
    also könnte mir das mal abendern sodas ich das nurnoch ersetzen muss!?
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[256];
    new tmp[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);

    if (!strcmp("/kill", cmdtext, true))
    {
    SetPlayerHealth(playerid, 0.0);
    return 1;
    }


  • public OnPlayerCommandText(playerid, cmdtext[])
    {
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[256];
    new tmp[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);
    if (!strcmp("/kill", cmdtext, true))
    {
    SetPlayerHealth(playerid, 0.0);
    return 1;
    }

    if(strcmp(cmdtext, "/rb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
    SetPlayerPos(playerid, X, Y, Z+4);
    RoadBlock[playerid] += 1;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
    return 1;
    }
    if(strcmp(cmdtext, "/drb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    if (RoadBlock[playerid] == 0) return SendClientMessage(playerid, COLOR_RED," You didn't add a roadblock!");
    DestroyObject(roadblock);
    RoadBlock[playerid] -= 0;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Removed");
    return 1;
    }

    return 0;
    }


    Ich scripte NICHT mehr, ich möchte mit NIEMANDEM einen Server aufmachen habe auch NICHTS mehr mit LoH zu tun, also lasst es mit den PNs!

  • Hab das jetzt so eingefügt


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[256];
    new tmp[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);
    if (!strcmp("/kill", cmdtext, true))
    {
    SetPlayerHealth(playerid, 0.0);
    return 1;
    }


    if(strcmp(cmdtext, "/rb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
    SetPlayerPos(playerid, X, Y, Z+4);
    RoadBlock[playerid] += 1;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Deployed");
    return 1;
    }
    if(strcmp(cmdtext, "/drb", true)==0)
    {
    if (gTeam[playerid] != TEAM_BLUE) return SendClientMessage(playerid, COLOR_RED," You're not a cop!");
    if (RoadBlock[playerid] == 0) return SendClientMessage(playerid, COLOR_RED," You didn't add a roadblock!");
    DestroyObject(roadblock);
    RoadBlock[playerid] -= 0;
    SendClientMessage(playerid, COLOR_GREEN, "RoadBlock Successfully Removed");
    return 1;
    }
    aber bekomme Dise Fehlermeldung!


    C:\Users\John\Desktop\Lee's test server package\gamemodes\stagethreerp.pwn(9506) : warning 217: loose indentation


    1 Warning.

    Was hab ich denn falsch gemacht ? ?(


    und die anderen beiden sachen hab ich hir eingefügt
    forward OnPlayerRename (name[],string[],playerid);
    forward ClearChatbox(playerid, lines);
    //------------------------------------------------------------------------------------------------------
    new roadblock; // <-- HIER
    new RoadBlock[MAX_PLAYERS]; // <-- HIER
    new Gate;
    // new License;
    new Security = 0;
    new CreatedCars[100];
    new CreatedCar = 0;
    new Tax = 0;

    Einmal editiert, zuletzt von JoJu_RED ()