Aduty Befehl

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
  • ocmd:aduty(playerid,params[])
    {
    if(PlayerInfo[playerid][pAdmin] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
    {
    if (aDuty[playerid] == 0) //Check if player is on duty
    {
    new string[128];
    new Float:x,Float:y,Float:z;
    new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position
    GetPlayerPos(playerid,x,y,z); //Looks for players position
    SetPlayerHealth(playerid,999999); //makes player godmode
    SetPlayerColor(playerid,COLOR_DRED); //set admin colour red
    SetPlayerSkin(playerid,294); //set admin skin to 294
    format(string,sizeof(string), "%s is now on Duty!",GetPlayerNameEx(playerid)); //here you format string to send to players
    SendClientMessageToAll(COLOR_DRED,string); //send string to players
    SendClientMessage(playerid,COLOR_DRED,"You are now on duty!"); //Tell admin he is now on duty
    Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player
    aDuty[playerid] = 1; //Set player on duty
    }
    else if (aDuty[playerid] == 1) //Check if player is on duty
    {
    new string[128];
    new Float:x,Float:y,Float:z;
    new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0);
    Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!"
    SetPlayerHealth(playerid,100); //sets player health back to 100
    format(string,sizeof(string)," %s is now off Duty!",GetPlayerNameEx(playerid)); //Format string to send to players
    SendClientMessageToAll(COLOR_DRED,string); //send players string
    SendClientMessage(playerid, COLOR_DRED,"You are now off duty!"); //send admin message he is off duty
    aDuty[playerid] = 0; //sets admin off duty
    }
    }
    else SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!"); //Error message to send to players who arent admins
    return 1;
    }

  • ocmd:aduty(playerid,params[]) { if(PlayerInfo[playerid][pAdmin] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 || { if (aDuty[playerid] == 0) //Check if player is on duty { new string[128]; new Float:x,Float:y,Float:z; new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position GetPlayerPos(playerid,x,y,z); //Looks for players position SetPlayerHealth(playerid,999999); //makes player godmode SetPlayerColor(playerid,COLOR_DRED); //set admin colour red SetPlayerSkin(playerid,294); //set admin skin to 294 format(string,sizeof(string), "%s is now on Duty!",GetPlayerNameEx(playerid)); //here you format string to send to players SendClientMessageToAll(COLOR_DRED,string); //send string to players SendClientMessage(playerid,COLOR_DRED,"You are now on duty!"); //Tell admin he is now on duty Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player aDuty[playerid] = 1; //Set player on duty } else if (aDuty[playerid] == 1) //Check if player is on duty { new string[128]; new Float:x,Float:y,Float:z; new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0); Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!" SetPlayerHealth(playerid,100); //sets player health back to 100 format(string,sizeof(string)," %s is now off Duty!",GetPlayerNameEx(playerid)); //Format string to send to players SendClientMessageToAll(COLOR_DRED,string); //send players string SendClientMessage(playerid, COLOR_DRED,"You are now off duty!"); //send admin message he is off duty aDuty[playerid] = 0; //sets admin off duty } } else SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!"); //Error message to send to players who arent admins return 1; }


    Danke aber jetzt Kommt das hier


    C:\Users\Justin Grosser\Desktop\Selfmade\gamemodes\Selfmade.pwn(42909) : error 017: undefined symbol "PlayerInfo"
    C:\Users\Justin Grosser\Desktop\Selfmade\gamemodes\Selfmade.pwn(42909) : warning 215: expression has no effect
    C:\Users\Justin Grosser\Desktop\Selfmade\gamemodes\Selfmade.pwn(42909) : error 001: expected token: ";", but found "]"
    C:\Users\Justin Grosser\Desktop\Selfmade\gamemodes\Selfmade.pwn(42909) : error 029: invalid expression, assumed zero
    C:\Users\Justin Grosser\Desktop\Selfmade\gamemodes\Selfmade.pwn(42909) : fatal error 107: too many error messages on one line


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



    4 Errors.