/teleport-to /teleport-here /spec

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 Brotfischer,
    Ich habe versucht ein /spec ID command zu Scripten für mein Stunt Server ... Ok es geht aber ich möchte nun das wenn man /spec 1 macht (Id 1 bin ich) Dass dan zu mir ne Nachricht geschickt wird ""NAME" will dich spectaten oder so tippe yes um anzunehmen tippe no um abzulehnen"
    Bei yes soll er dann specen können und bei no kommt ne nachricht"Der andere Spieler hat die Spec abfrage abgelehnt"
    Das gleiche wollte ich mit /teleporthere(Um einen her zu porten) und /teleportto (Um sich zu einem zu porten)



    Ich hoffe jemand kann mir sowas Scripten oder ein beispiel machen.
    MFG alex

    DIK2gXr.png

    5 Mal editiert, zuletzt von DurtyFree ()

  • public OnPlayerCommandText(playerid, cmdtext[])
    {
    dcmd(goto,4,cmdtext);
    return 1;
    }


    dcmd_goto(playerid, params[]) {
    if(IsPlayerAdmin(playerid) ) return SendClientMessage(playerid, RED, "Du bist kein Admin!");
    new spieler;
    if(sscanf(params,"d",spieler)) return SendClientMessage(playerid, RED,"Benutze \"/goto <playerid>\"");
    if(!IsPlayerConnected(spieler))return SendClientMessage(playerid,RED,"Dieser Spieler ist nicht Online!");
    new Float:g_XX,Float:g_YY,Float:g_ZZ;
    GetPlayerPos(spieler,g_XX,g_YY,g_ZZ);
    SetPlayerPos(playerid,g_XX,g_YY,g_ZZ+0.5);
    return 1;
    }


    Das Wäre mal der Befehl um spieler porten

  • dcmd_autospawn(playerid,params[]) {
    if(!strlen(params)) return SendClientMessage(playerid,FARBE,"/autospawn FahrzeugID oder Fahrzeugname");
    new autonamen[][]= {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel", "Sentinel", "Dumper", "Feuertruck 1",
    "Müllauto", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Krankenwagen",
    "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Eiswagen", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Sicherheitsauto", "Banshee", "Predator", "Bus", "Rhino", "Barracks",
    "Hotknife", "Article Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit",
    "Romero", "Packer", "Monster Truck", "Admiral", "Squallo", "Seasparrow", "Pizzaboy", "Tram",
    "Article Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbad", "Yankee", "Caddy", "Soliar",
    "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Kuestenwache", "Dinghy", "Hermes", "Sabre",
    "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage",
    "Dozer", "Maverick", "SAN News Maverick", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax",
    "Hotring Racer 1", "Sandking", "Balista Compact", "Polizei Maverick", "Boxville", "Benson", "Mesa",
    "RC Goblin", "Hotring Racer 2", "Hotring Racer 3", "Bloodring Banger", "Rancher", "Super GT", "Elegant",
    "Journey", "Fahrrad", "Mountain Bike", "Beagle", "Cropduster", "Stuntflugzeug", "Benzin Tanker",
    "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV-1000",
    "Zement Truck", "Abschlepper", "Fortune", "Cadrona", "FBI Truck", "Willard", "Gabelstabler",
    "Traktor", "Maehdrescher", "Feltzer", "Remington", "Slamvan", "Blade", "Brownstreak", "Freight",
    "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Feuertruck 2", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor",
    "Monster Truck", "Monster Truck", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
    "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat Trailer", "Streak Trailer",
    "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford",
    "BF-400", "Nachrichten Van", "Tug", "Benzin Anhaenger", "Emperor", "Wayfarer", "Euros", "Hotdog",
    "Club", "Freight Box Trailer", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch",
    "Polizeiauto LSPD", "Polizeiauto SFPD", "Polizeiauto LVPD", "Ranger", "Picador", "Wasserwerfer",
    "Alpha", "Phoenix", "Glendale Shit", "Sadler Shit", "Baggage Trailer 1", "Baggage Trailer 2",
    "Tug Stairs Trailer", "Boxburg", "Farm Trailer", "Utility Trailer" }, id, geht;
    for(new i, j=strlen(params); i<j; i++) {
    if((params[i]<0 || params[i]>9) && params[i]!=' ') {
    geht++;
    i=j; }}
    if(!geht) {
    id=strval(params); }
    else {
    for(new m=0; m<211; m++) {
    if(strfind(autonamen[m],params,true)==0) {
    id=m+400; }}}
    if(id>=400 && id<=611) {
    new Float:x, Float:y, Float:z, gla, Float:za, s[50];
    format(s,sizeof(s),"Du hast eine/n %s gespawnt",autonamen[id-400]);
    SendClientMessage(playerid,FARBE,s);
    GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,za);
    gla=CreateVehicle(id,x+2,y,z,za,random(127),random(127),-1);
    LinkVehicleToInterior(gla,GetPlayerInterior(playerid)); }
    else { SendClientMessage(playerid,rot,"Inkorrekte Fahrzeug ID"); }
    return 1;
    }

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Omg xD Soweit bin ich auch :|
    Mein einziges Problem ist die Abfrage wo davor versendet wird -.-
    Nochmal ein BSP. Spieler A mach /spec B dann griegt Spieler B ne nachricht das Spieler A ihn Spectaten will dann muss Spieler B eintippen "yes" für ja "no" für nein.......
    Das gleiche mit den /teleport-to /teleport-here ^^


    MFg aex

  • Sry Für doppelpost ;(
    KEKS
    Kannste den Befehl in Strok umschreiben
    dcmd_autospawn(playerid,params[]) {
    if(!strlen(params)) return SendClientMessage(playerid,FARBE,"/autospawn FahrzeugID oder Fahrzeugname");
    new autonamen[][]= {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel", "Sentinel", "Dumper", "Feuertruck 1",
    "Müllauto", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Krankenwagen",
    "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Eiswagen", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Sicherheitsauto", "Banshee", "Predator", "Bus", "Rhino", "Barracks",
    "Hotknife", "Article Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit",
    "Romero", "Packer", "Monster Truck", "Admiral", "Squallo", "Seasparrow", "Pizzaboy", "Tram",
    "Article Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbad", "Yankee", "Caddy", "Soliar",
    "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Kuestenwache", "Dinghy", "Hermes", "Sabre",
    "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage",
    "Dozer", "Maverick", "SAN News Maverick", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax",
    "Hotring Racer 1", "Sandking", "Balista Compact", "Polizei Maverick", "Boxville", "Benson", "Mesa",
    "RC Goblin", "Hotring Racer 2", "Hotring Racer 3", "Bloodring Banger", "Rancher", "Super GT", "Elegant",
    "Journey", "Fahrrad", "Mountain Bike", "Beagle", "Cropduster", "Stuntflugzeug", "Benzin Tanker",
    "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV-1000",
    "Zement Truck", "Abschlepper", "Fortune", "Cadrona", "FBI Truck", "Willard", "Gabelstabler",
    "Traktor", "Maehdrescher", "Feltzer", "Remington", "Slamvan", "Blade", "Brownstreak", "Freight",
    "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Feuertruck 2", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor",
    "Monster Truck", "Monster Truck", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
    "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat Trailer", "Streak Trailer",
    "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford",
    "BF-400", "Nachrichten Van", "Tug", "Benzin Anhaenger", "Emperor", "Wayfarer", "Euros", "Hotdog",
    "Club", "Freight Box Trailer", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch",
    "Polizeiauto LSPD", "Polizeiauto SFPD", "Polizeiauto LVPD", "Ranger", "Picador", "Wasserwerfer",
    "Alpha", "Phoenix", "Glendale Shit", "Sadler Shit", "Baggage Trailer 1", "Baggage Trailer 2",
    "Tug Stairs Trailer", "Boxburg", "Farm Trailer", "Utility Trailer" }, id, geht;
    for(new i, j=strlen(params); i<j; i++) {
    if((params[i]<0 || params[i]>9) && params[i]!=' ') {
    geht++;
    i=j; }}
    if(!geht) {
    id=strval(params); }
    else {
    for(new m=0; m<211; m++) {
    if(strfind(autonamen[m],params,true)==0) {
    id=m+400; }}}
    if(id>=400 && id<=611) {
    new Float:x, Float:y, Float:z, gla, Float:za, s[50];
    format(s,sizeof(s),"Du hast eine/n %s gespawnt",autonamen[id-400]);
    SendClientMessage(playerid,FARBE,s);
    GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,za);
    gla=CreateVehicle(id,x+2,y,z,za,random(127),random(127),-1);
    LinkVehicleToInterior(gla,GetPlayerInterior(playerid)); }
    else { SendClientMessage(playerid,rot,"Inkorrekte Fahrzeug ID"); }
    return 1;
    }


    MFG alex :
    huh:

    DIK2gXr.png

    2 Mal editiert, zuletzt von DurtyFree ()

  • Kann mir einer das in Stock umschreiben?
    Weil als if(strcmp(cmdtext, "/spawn", true) == 0) {
    if(!strlen(params)) return SendClientMessage(playerid,FARBE,"/autospawn FahrzeugID oder Fahrzeugname");
    new autonamen[][]= {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel", "Sentinel", "Dumper", "Feuertruck 1",
    "Müllauto", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Krankenwagen",
    "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Eiswagen", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Sicherheitsauto", "Banshee", "Predator", "Bus", "Rhino", "Barracks",
    "Hotknife", "Article Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit",
    "Romero", "Packer", "Monster Truck", "Admiral", "Squallo", "Seasparrow", "Pizzaboy", "Tram",
    "Article Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbad", "Yankee", "Caddy", "Soliar",
    "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Kuestenwache", "Dinghy", "Hermes", "Sabre",
    "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage",
    "Dozer", "Maverick", "SAN News Maverick", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax",
    "Hotring Racer 1", "Sandking", "Balista Compact", "Polizei Maverick", "Boxville", "Benson", "Mesa",
    "RC Goblin", "Hotring Racer 2", "Hotring Racer 3", "Bloodring Banger", "Rancher", "Super GT", "Elegant",
    "Journey", "Fahrrad", "Mountain Bike", "Beagle", "Cropduster", "Stuntflugzeug", "Benzin Tanker",
    "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV-1000",
    "Zement Truck", "Abschlepper", "Fortune", "Cadrona", "FBI Truck", "Willard", "Gabelstabler",
    "Traktor", "Maehdrescher", "Feltzer", "Remington", "Slamvan", "Blade", "Brownstreak", "Freight",
    "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Feuertruck 2", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor",
    "Monster Truck", "Monster Truck", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
    "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat Trailer", "Streak Trailer",
    "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford",
    "BF-400", "Nachrichten Van", "Tug", "Benzin Anhaenger", "Emperor", "Wayfarer", "Euros", "Hotdog",
    "Club", "Freight Box Trailer", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch",
    "Polizeiauto LSPD", "Polizeiauto SFPD", "Polizeiauto LVPD", "Ranger", "Picador", "Wasserwerfer",
    "Alpha", "Phoenix", "Glendale Shit", "Sadler Shit", "Baggage Trailer 1", "Baggage Trailer 2",
    "Tug Stairs Trailer", "Boxburg", "Farm Trailer", "Utility Trailer" }, id, geht;
    for(new i, j=strlen(params); i<j; i++) {
    if((params<0 || params>9) && params!=' ') {
    geht++;
    i=j; }}
    if(!geht) {
    id=strval(params); }
    else {
    for(new m=0; m<211; m++) {
    if(strfind(autonamen[m],params,true)==0) {
    id=m+400; }}}
    if(id>=400 && id<=611) {
    new Float:x, Float:y, Float:z, gla, Float:za, s[50];
    format(s,sizeof(s),"Du hast eine/n %s gespawnt",autonamen[id-400]);
    SendClientMessage(playerid,FARBE,s);
    GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,za);
    gla=CreateVehicle(id,x+2,y,z,za,random(127),random(127),-1);
    LinkVehicleToInterior(gla,GetPlayerInterior(playerid)); }
    else { SendClientMessage(playerid,rot,"Inkorrekte Fahrzeug ID"); }
    return 1;
    }

    Diese Errors bekommen hatte


    C:\Dokumente und Einstellungen\Anwender\Desktop\stunt.pwn(4428) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Anwender\Desktop\stunt.pwn(4457) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Anwender\Desktop\stunt.pwn(4458) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Anwender\Desktop\stunt.pwn(4462) : error 017: undefined symbol "params"
    C:\Dokumente und Einstellungen\Anwender\Desktop\stunt.pwn(4465) : error 017: undefined symbol "params"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.


    Und dann hat ein Typ geschrieben:
    strcmp doesn't give you 'params'. Use strtok for that


    Der nächste schrieb das:
    Step one: don't put such a huge array in each command, simply put it as a global variable
    Step two: learn to indent properly
    Step three: read this, this, this and this.


    MFg alex

  • if(strcmp(cmdtext, "/teleportto", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new id = strval(strget(cmdtext,1));
    if(!strlen(strget(cmdtext,1)))
    {
    SendClientMessage(playerid,0xFF6347AA,"Benutze: /teleportto [ID]"); return 1;
    }
    if(id > 200 || id < 0)
    {
    SendClientMessage(playerid,0xFF6347AA,"Falsche ID!");
    return 1;
    }
    new pName[24], str[64];
    GetPlayerName(playerid, pName, 24);
    format(str, 64, "Admin %s möchte sich zu dir Porten. Benutze /accept teleport um anzunehmen oder /cancel teleport, um abzulehnen!", pName);
    SendClientMessage(id, 0xA9A9A9AA, str);
    }
    new tpp[256];
    if(strcmp(tpp,"/accept teleport",true) == 0)
    {
    new id = strval(strget(cmdtext,1));
    SendClientMessage(playerid, 0xFF6347AA, " Der Spieler hat angenommen");
    new Float: t_y ,Float: t_x,Float: t_z;
    GetPlayerPos(id, t_y, t_x, t_z);
    SetPlayerPos(playerid, t_y, t_x, t_z);
    return 1;}
    if(strcmp(tpp,"/cancel teleport",true) == 0)
    {
    SendClientMessage(playerid, 0xFF6347AA, " Der Spieler hat abgelehnt!");
    return 1;}
    }


    ungetestet

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen