[FRAGE] Skins nur für bestimmte Leute

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 Community,
    Ich habe ein Problem und zwar folgendes, ich habe diese Frage schon mehr mals gestellt und noch nie eine richtige Antwort bekommen. Also meiner Frage ich möcht e das nur Player die Polizeiklasse wählen können die einen Score von 250 haben. Nur wo muss diese Abfrage hin wäre nett wenn ihr mir helfen könntet. Hier ist ein Ausschnitt aus meinem Script. Wäre nett wenn ihr mir das daran erklären könntet.

    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,200.0760,-126.8279,1003.5152);
    SetPlayerFacingAngle(playerid,135.5062);
    SetPlayerCameraPos(playerid,198.8689,-130.0491,1003.5152);
    SetPlayerCameraLookAt(playerid,200.0760,-126.8279,1003.5152);
    SetPlayerInterior(playerid,3);
    ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
    switch(classid)
    {
    case 0: {GameTextForPlayer(playerid,"~g~ROADWORKER",2000,3);SetPlayerColor(playerid,0xFF7800FF);SetPVarInt(playerid,"Fraktion",1);}
    case 1: {GameTextForPlayer(playerid,"~g~ROADWORKER",2000,3);SetPlayerColor(playerid,0xFF7800FF);SetPVarInt(playerid,"Fraktion",1);}
    case 2: {GameTextForPlayer(playerid,"~g~ROADWORKER",2000,3);SetPlayerColor(playerid,0xFF7800FF);SetPVarInt(playerid,"Fraktion",1);}
    case 3: {GameTextForPlayer(playerid,"~g~PILOT",2000,3);SetPlayerColor(playerid,GRÜN);SetPVarInt(playerid,"Fraktion",2);}
    case 4: {GameTextForPlayer(playerid,"~g~PILOT",2000,3);SetPlayerColor(playerid,GRÜN);SetPVarInt(playerid,"Fraktion",2);}
    case 5: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 6: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 7: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 8: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 9: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 10: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 11: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 12: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 13: {GameTextForPlayer(playerid,"~g~TRUCKER",2000,3);SetPlayerColor(playerid,0x969696FF);SetPVarInt(playerid,"Fraktion",3);}
    case 14: {GameTextForPlayer(playerid,"~g~POLIZIST",2000,3);SetPlayerColor(playerid,BLAU);SetPVarInt(playerid,"Fraktion",4);}
    case 15: {GameTextForPlayer(playerid,"~g~POLIZIST",2000,3);SetPlayerColor(playerid,BLAU);SetPVarInt(playerid,"Fraktion",4);}
    case 16: {GameTextForPlayer(playerid,"~g~POLIZIST",2000,3);SetPlayerColor(playerid,BLAU);SetPVarInt(playerid,"Fraktion",4);}
    case 17: {GameTextForPlayer(playerid,"~g~BUSFAHRER",2000,3);SetPlayerColor(playerid,GOLD);SetPVarInt(playerid,"Fraktion",5);}
    case 18: {GameTextForPlayer(playerid,"~g~BUSFAHRER",2000,3);SetPlayerColor(playerid,GOLD);SetPVarInt(playerid,"Fraktion",5);}
    case 19: {GameTextForPlayer(playerid,"~g~KURIER",2000,3);SetPlayerColor(playerid,GELB);SetPVarInt(playerid,"Fraktion",6);}
    case 20: {GameTextForPlayer(playerid,"~g~KURIER",2000,3);SetPlayerColor(playerid,GELB);SetPVarInt(playerid,"Fraktion",6);}
    }
    return 1;
    }

    Ich bedanke mich schonmal an alle die mir eine sinnvolle Antwort geben.


    MFG


    xKrUsE6x


    PS: Wenn ihr mehr Informationen braucht sagt bescheit.

    Gruß


    xKrUsE6x :thumbup:

  • Hab hier mal ein Test gemacht mit meiner Adminabfrage aber bekomm errors.
    Zeile:  
    if(isPlayerAnAdmin(playerid,2)){case 14:
    {GameTextForPlayer(playerid,"~g~POLIZIST",2000,3);SetPlayerColor(playerid,BLAU);SetPVarInt(playerid,"Fraktion",4);}else{GameTextForPlayer(playerid,"~r~Du ~r~brauchst ~r~250 ~r~Score",2000,3);}}
    und die Erros:

    C:\Users\Kruse\Desktop\Programme\samp\Truck Server\gamemodes\truckserver.pwn(587) : error 002: only a single statement (or expression) can follow each "case"
    C:\Users\Kruse\Desktop\Programme\samp\Truck Server\gamemodes\truckserver.pwn(587) : error 028: invalid subscript (not an array or too many subscripts): "isPlayerAnAdmin"
    C:\Users\Kruse\Desktop\Programme\samp\Truck Server\gamemodes\truckserver.pwn(587) : error 001: expected token: "}", but found "case"
    C:\Users\Kruse\Desktop\Programme\samp\Truck Server\gamemodes\truckserver.pwn(587) : 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.


    Gruß


    xKrUsE6x :thumbup: