Brauche 2Befehle

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
  • if(strcmp(cmd, "/setskin", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Hilfe : /setskin [playerid/PartOfName] [skin model]");
    return 1;
    }
    new playa;
    new health;
    playa = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    health = strvalEx(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 4)
    {
    if(IsPlayerConnected(playa))
    {
    if(playa != INVALID_PLAYER_ID)
    {
    new name[20];
    new victim[20];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(playa, victim, sizeof(victim));
    PlayerInfo[playa][pModel] = health;
    PlayerInfo[playa][pChar] = health;
    SetPlayerSkin(playa, PlayerInfo[playa][pChar]);
    format(string, 256, "AdmWarning: [%s] Skin was just set to %d by %s!",victim,health,name);
    ABroadCast(COLOR_YELLOW,string,1347);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du darfst diesen CMD nicht nutzen,schäm dich!");
    }
    }
    return 1;
    }



    if(strcmp(cmd, "/givegun", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /givegun [playerid] [weaponid(eg. 46 = Parachute)] [ammo]");
    return 1;
    }
    new playa;
    new gun;
    new ammo;
    playa = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    gun = strval(tmp);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /givegun [playerid] [weaponid] [ammo]");
    SendClientMessage(playerid, COLOR_GRAD4, "3(Club) 4(knife) 5(bat) 6(Shovel) 7(Cue) 8(Katana) 10-13(Dildo) 14(Flowers) 16(Grenades) 18(Molotovs) 22(Pistol) 23(SPistol)");
    SendClientMessage(playerid, COLOR_GRAD3, "24(Eagle) 25(shotgun) 29(MP5) 30(AK47) 31(M4) 33(Rifle) 34(Sniper) 37(Flamethrower) 41(spray) 42(exting) 43(Camera) 46(Parachute)");
    return 1;
    }
    if(gun < 1||gun > 46||gun==27||gun==1||gun==2||gun==9||gun==17||gun==19||gun==20||gun==21||gun==36||gun==38||gun==39||gun==40||gun==44||gun==45)
    { SendClientMessage(playerid, COLOR_GRAD1, " wrong WeaponID!"); return 1; }
    tmp = strtok(cmdtext, idx);
    ammo = strval(tmp);
    if(ammo <1||ammo > 999)
    { SendClientMessage(playerid, COLOR_GRAD1, " dont go below 1 or above 999 bullets!"); return 1; }
    if (PlayerInfo[playerid][pAdmin] >= 1338)
    {
    if(IsPlayerConnected(playa))
    {
    if(playa != INVALID_PLAYER_ID)
    {
    GivePlayerWeapon(playa, gun, ammo);
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht befugt!");
    }
    }
    return 1;
    }


    Sind ausm GF ;)

  • Selfmade:


    ocmd:setskin(playerid,params[])
    {
    new skinid1,pID,string[128];
    if(sscanf(params,"ud",pID,skinid1))return SendClientMessage(playerid, BLAU,"/setskin [PLAYERID] [SKINID]");
    if(isPlayerAnAdmin(playerid,1))
    {
    SetPlayerSkin(pID,skinid1);
    format(string,sizeof(string),"Ein Admin hat dir den Skin %d zugewiesen!",skinid1);
    SendClientMessage(pID,BLAU,string);
    }
    else
    {
    SendClientMessage(playerid,ROT,"Diesen Befehl kannst du nicht nutzen. Mindestens benötigter Rang: {00FF5A}Supporter");
    }
    return 1;
    }


    ocmd:gibwaffe(playerid,params[])
    {
    if(!isPlayerAnAdmin(playerid,2))return SendClientMessage(playerid,ROT,"Du bist kein Admin der Stufe 2.");
    new pID,wID,ammo;
    if(sscanf(params,"uii",pID,wID,ammo))return SendClientMessage(playerid,BLAU,"Nutze /giveweapon [id] [waffe] [ammo]");
    if(wID<1||wID>40)return SendClientMessage(playerid,ROT,"Du kannst nur eine Waffen von 1-40 wählen");
    GivePlayerWeapon(pID,wID,ammo);
    return 1;
    }

  • ocmd:gibwaffe(playerid,params[])
    {
    new pID,wID,ammo;
    if(sscanf(params,"uii",pID,wID,ammo))return SendClientMessage(playerid,BLAU,"Nutze /giveweapon [id] [waffe] [ammo]");
    if(wID<1||wID>40)return SendClientMessage(playerid,ROT,"Du kannst nur eine Waffen von 1-40 wählen");
    GivePlayerWeapon(pID,wID,ammo);
    return 1;
    }


    ocmd:setskin(playerid,params[])
    {
    new skinid1,pID,string[128];
    if(sscanf(params,"ud",pID,skinid1))return SendClientMessage(playerid, BLAU,"/setskin [PLAYERID] [SKINID]");
    SetPlayerSkin(pID,skinid1);
    format(string,sizeof(string),"Ein Admin hat dir den Skin %d zugewiesen!",skinid1);
    SendClientMessage(pID,BLAU,string);
    return 1;
    }