Wenn ein bestimmter Text = bestimmte Funktion

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
  • Hallo liebe Brotfische :).
    Also ich möchte gerne das man mit /gebeschein [schein] [playerid] einen Schein gibt.
    Aber es gibt ja auch nicht nur einen schein. Kann mir jemand sagen dass wenn bei Schein fuehrerschein steht dass die lizens "Führerschein" gegeben wird. (Wenn es geht in DCMD).
    Ich hoffe ihr versteht was ich meine.
    mfg SiriiuzZ

  • Hier Versuchs mal damit wen du das net rein bekommst mache ich es dir gerne rein ^^


    if(strcmp(cmd, "/agivelicense", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsAnInstructor(playerid) || PlayerInfo[playerid][pAdmin] >= 1337) { if(PlayerInfo[playerid][pRank] < 0 || PlayerInfo[playerid][pAdmin] >= 1337) { SendClientMessage(playerid, COLOR_GREY, " Nur Admins dürfen diesen Befehl nutzen!"); return 1; } new x_nr[256]; x_nr = strtok(cmdtext, idx); if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense [name] [playerid/PartOfName]"); SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, alle."); return 1; } if(strcmp(x_nr,"driving",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Driving [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s einen Führerschein gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s hat dir ein Führerschein gegeben.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pCarLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " That player is Offline !"); return 1; } } else if(strcmp(x_nr,"flying",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Flying [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s einen Flugschein gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s hat dir ein Flugschein gegeben.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pFlyLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " That player is Offline !"); return 1; } } else if(strcmp(x_nr,"sailing",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Sailing [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s einen Angelschein gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s hat dir ein Angelschein gegeben.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pBoatLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " That player is Offline !"); return 1; } } else if(strcmp(x_nr,"fishing",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Fishing [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s ein fisherschein gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s hat dir ein fischerschein gegeben!.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pFishLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !"); return 1; } } else if(strcmp(x_nr,"alle",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense alle [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s alle Scheine gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s hat dir alle scheine gegeben!.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pFishLic] = 1; PlayerInfo[giveplayerid][pFlyLic] = 1; PlayerInfo[giveplayerid][pCarLic] = 1; PlayerInfo[giveplayerid][pGunLic] = 1; PlayerInfo[giveplayerid][pBoatLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !"); return 1; } } else if(strcmp(x_nr,"weapon",true) == 0) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Weapon [playerid/PartOfName]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* Du hast %s ein Waffenschein gegeben.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin % hat dir den Waffenschein gegeben.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pGunLic] = 1; return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, " Du bist kein Admin !"); return 1; } } return 1; }