Beiträge von Haxler

    Zitat

    Bekannte Fehler
    • Die Projektile münden nicht aus der Waffe
    • Die Zombies gewähren kein Geld, daher endet die Geschichte schon nach ein paar Minuten.
    • Spieler kann noch nicht sterben


    ich denke er weiß das alles schon^^

    ocmd:had(playerid,params[])
    {
    if(!strlen(params))return SendClientMessage(playerid,0xFF0000FF,"NUTZUNG: /had [Text]");
    new str[128];
    format(str,128,"(( %s ))",params);
    SendClientMessageToAll(0xFF0000FF,str); //Sendet in Rot
    return 1;
    }

    if(strcmp(cmdtext, "/enter", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
    if(PlayerToPoint(3.0,playerid,2597.7322,1900.3004,11.0312))
    {
    SetPlayerPos(playerid,140.0937,1368.6858,1083.8634);
    SetPlayerInterior(playerid,5);
    SetPlayerVirtualWorld(playerid, 2);
    }
    }
    else if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    {
    if(PlayerToPoint(5,playerid,691.2778,-1275.9631,13.5605))
    {
    SetPlayerPos(playerid,140.0937,1368.6858,1083.8634);
    SetPlayerInterior(playerid,5);
    SetPlayerVirtualWorld(playerid, 1);
    SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to La Costa Nostra home kid ,enjoy !");
    }
    }
    }
    return 1;
    }
    teste das mal

    Und wieso musst du das *then hinmachen? Sowas gibt es in Pawno doch garnicht. Guck mal meinen Beitrag weiter oben an...
    €d!t: und versuch mal aus if PlayerToPoint(3.0,playerid,691.2778,-1275.9631,13.5605) das zu machen: if(PlayerToPoint(3.0,playerid,691.2778,-1275.9631,13.5605))

    Denke mal eher so:
    if(strcmp(cmdtext, "/enter", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
    if PlayerToPoint(3.0,playerid,2597.7322,1900.3004,11.0312)
    {
    SetPlayerPos(playerid,140.0937,1368.6858,1083.8634);
    SetPlayerInterior(playerid,5);
    SetPlayerVirtualWorld(playerid, 2);
    }
    }
    else if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    {
    if PlayerToPoint(5,playerid,691.2778,-1275.9631,13.5605)
    {
    SetPlayerPos(playerid,140.0937,1368.6858,1083.8634);
    SetPlayerInterior(playerid,5);
    SetPlayerVirtualWorld(playerid, 1);
    SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to La Costa Nostra home kid ,enjoy !");
    }
    }
    }
    return 1;
    }

    Geht doch viel einfacher:
    new CarName[][] =
    {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
    "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
    "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
    "Rhino", "Barracks", "Hotknife", "Trailer 1", "Previon", "Coach", "Cabbie",
    "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
    "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder",
    "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
    "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
    "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
    "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
    "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
    "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
    "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
    "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
    "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
    "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
    "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
    "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
    "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
    "Tiller", "Utility Trailer"
    };

    jetzt einfach:
    CarName[modelid-400]);
    edit: ah habs andersrum gedacht^^ ja kannst einfach mit einer Schleife durch alle Einträge gehen und mit strcmp vergleichen

    Genau da liegt das Problem. Dann lernen die Anfänger wie man ressourcen-fressend scriptet.



    //global:
    new PlayerName[MAX_PLAYERS][MAX_PLAYERNAME];
    // OnPlayerConnect:
    GetPlayerName(playerid,PlayerName[playerid],MAX_PLAYERNAME);
    jetzt kannst du das so verwenden:
    new s[50];
    format(s,50,"Du heißt: %s",PlayerName[playerid]);

    Zitat

    oder einfach ein stock


    und was soll das für einen Sinn haben? Die GetPlayerName-Funktion wird dann trotzdem jedes mal aufgerufen. Es reicht doch wenn die Funktion nur einmal beim Connecten aufgerufen wird.

    Ich finds nicht so toll :/
    - Viele Schreibfehler ("Du hast dir ein Essen gekauft")
    - nicht sehr Ressourcenschonend (new tmp[200]; unter OnPlayerCommandText)
    - unübersichtlich (ocmd und strcmp?)
    Anstatt immer "new spieler[MAX_PLAYERNAME]; GetPlayerName(...)" könntest du auch einfach eine Variable new PlayerName[MAX_PLAYERS][MAX_PLAYERNAME] erstelle, die du dann bei OnPlayerConnect formatierst.