Beiträge von aTraX

    public OnPlayerRequestClass(playerid, classid)
    {
    if(classid >= 0 && classid <= 0)
    {
    new String[128];
    format(String, sizeof(String), "~n~~n~~n~~g~Grove Street Families~n~~w~Los Santos");
    GameTextForPlayer(playerid,String,5000,3);
    SetPlayerPos(playerid, 2507.9360, -1654.9623, 13.5938);
    SetPlayerFacingAngle(playerid, 87.93);
    SetPlayerCameraPos(playerid, 2502.7065,-1654.7733,13.5071);
    SetPlayerCameraLookAt(playerid, 2507.9360, -1654.9623, 13.5938);
    SetPlayerColor(playerid,dunkelgrun);
    }
    }


    also so haste keine errors

    dcmd_cpos(playerid,params[])
    {
    new pID, Float:X, Float:Y, Float:Z, Float:A, intid;
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    return SendClientMessage(playerid, 0xFF0000FF, "Du bist kein Admin !");
    }
    if(sscanf(params, "dffffd",pID, X, Y, Z, A, intid))
    {
    return SendClientMessage(playerid,0xFFFFFFFF,"TIPPE: /cpos [playerid] [X] [Y] [Z] [A] [INTERIOR]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,0xFF0000FF,"Kein Spieler mit angegebener ID Online");
    }
    SetPlayerPos(pID, X, Y, Z); SetPlayerFacingAngle(pID, A); SetPlayerInterior(pID, intid);
    SendClientMessage(playerid,0xFFFFFFFF,"Spieler wurde zu einer anderen Pos. gebeamt !");
    return 1;
    }


    so isses richtig :D und das hier oben is mit admin und das unter ohne :D


    dcmd_cpos(playerid,params[])
    {
    new pID, Float:X, Float:Y, Float:Z, Float:A, intid;
    if(sscanf(params, "dffffd",pID, X, Y, Z, A, intid))
    {
    return SendClientMessage(playerid,0xFFFFFFFF,"TIPPE: /cpos [playerid] [X] [Y] [Z] [A] [INTERIOR]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,0xFF0000FF,"Kein Spieler mit angegebener ID Online");
    }
    SetPlayerPos(pID, X, Y, Z); SetPlayerFacingAngle(pID, A); SetPlayerInterior(pID, intid);
    SendClientMessage(playerid,0xFFFFFFFF,"Spieler wurde zu einer anderen Pos. gebeamt !");
    return 1;
    }

    So als Dcmd variante :P


    dcmd_cpos(playerid,params[])
    {
    new pID, Float:X, Float:Y, Float:Z, Float:A, intid;
    if(!IsPlayerAdmin(playerid))
    {
    return SendClientMessage(playerid, 0xFF0000FF, "Du bist kein Admin !");
    }
    if(sscanf(params, "dffffd",pID, X, Y, Z, A, intid))
    {
    return SendClientMessage(playerid,0xFFFFFFFF,"TIPPE: /cpos [playerid] [X] [Y] [Z] [A] [INTERIOR]");
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,0xFF0000FF,"Kein Spieler mit angegebener ID Online");
    }
    SetPlayerPos(pID, X, Y, Z); SetPlayerFacingAngle(pID, A); SetPlayerInterior(pID, intid);
    SendClientMessage(playerid,0xFFFFFFFF,"Spieler wurde zu einer anderen Pos. gebeamt !");
    return 1;
    }


    bein OnPlayerCommandText


    dcmd(cpos, 4, cmdtext);


    SSCANF


    #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

    so is richtig denk ich ma: ;)


    dcmd_zahl(playerid, params[])
    {
    new Float:Zahl, form[100];
    if(sscanf(params,"f",Zahl))
    {
    return SendClientMessage(playerid,COLOR_RED,"Verwende: /zahl [FLOAT] ");
    }
    dini_FloatSet("File.ini","Zahl",Zahl);
    format(form,sizeof form,"Die Zahl %f wurde gespeichert",Zahl);
    return SendClientMessage(playerid,COLOR_RED,form);
    }


    EDIT:


    So jetzt aber xD

    new vNames[][] =
    {
    "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", "Previon", "Coach",
    "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow",
    "Pizzaboy", "Tram", "Trailer", "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", "Stratum", "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", "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"
    };


    das nach oben und das:


    if(GetPlayerState(playerid) ==2)
    {
    new string[128];
    format(string, sizeof(string), "~n~~n~~n~~n~~w~%s",vNames[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    GameTextForPlayer(playerid, string, 2000, 1);
    }


    unter OnPlayerStateChange

    ganz oben unter die includes


    fine dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


    i-wo ins script:


    dcmd_freezeplayerfor5seconds(playerid,params[]) {
    new ID;
    if(sscanf(params, "d",ID)) {
    return SendClientMessage(playerid,COLOR_RED,"USAGE: /freezeplayerfor5seconds [playerid]");
    }
    if(!IsPlayerConnected(pID)) {
    return SendClientMessage(playerid,COLOR_RED,"Kein Spieler mit angegebener ID Online");
    }
    TogglePlayerControllable(ID, 0);
    SetTimer("unfreeze", 5000, 0);
    return 1;
    }


    forward unfreeze(playerid)
    public unfreeze(playerid)
    {
    TogglePlayerControllable(playerid, 1);
    }


    stock sscanf(string[], format[], {Float,_}:...)
    {
    #if defined isnull
    if (isnull(string))
    #else
    if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
    #endif
    {
    return format[0];
    }
    #pragma tabsize 4
    new
    formatPos = 0,
    stringPos = 0,
    paramPos = 2,
    paramCount = numargs(),
    delim = ' ';
    while (string[stringPos] && string[stringPos] <= ' ')
    {
    stringPos++;
    }
    while (paramPos < paramCount && string[stringPos])
    {
    switch (format[formatPos++])
    {
    case '\0':
    {
    return 0;
    }
    case 'i', 'd':
    {
    new
    neg = 1,
    num = 0,
    ch = string[stringPos];
    if (ch == '-')
    {
    neg = -1;
    ch = string[++stringPos];
    }
    do
    {
    stringPos++;
    if ('0' <= ch <= '9')
    {
    num = (num * 10) + (ch - '0');
    }
    else
    {
    return -1;
    }
    }
    while ((ch = string[stringPos]) > ' ' && ch != delim);
    setarg(paramPos, 0, num * neg);
    }
    case 'h', 'x':
    {
    new
    num = 0,
    ch = string[stringPos];
    do
    {
    stringPos++;
    switch (ch)
    {
    case 'x', 'X':
    {
    num = 0;
    continue;
    }
    case '0' .. '9':
    {
    num = (num << 4) | (ch - '0');
    }
    case 'a' .. 'f':
    {
    num = (num << 4) | (ch - ('a' - 10));
    }
    case 'A' .. 'F':
    {
    num = (num << 4) | (ch - ('A' - 10));
    }
    default:
    {
    return -1;
    }
    }
    }
    while ((ch = string[stringPos]) > ' ' && ch != delim);
    setarg(paramPos, 0, num);
    }
    case 'c':
    {
    setarg(paramPos, 0, string[stringPos++]);
    }
    case 'f':
    {
    setarg(paramPos, 0, _:floatstr(string[stringPos]));
    }
    case 'p':
    {
    delim = format[formatPos++];
    continue;
    }
    case '\'':
    {
    new
    end = formatPos - 1,
    ch;
    while ((ch = format[++end]) && ch != '\'') {}
    if (!ch)
    {
    return -1;
    }
    format[end] = '\0';
    if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
    {
    if (format[end + 1])
    {
    return -1;
    }
    return 0;
    }
    format[end] = '\'';
    stringPos = ch + (end - formatPos);
    formatPos = end + 1;
    }
    case 'u':
    {
    new
    end = stringPos - 1,
    id = 0,
    bool:num = true,
    ch;
    while ((ch = string[++end]) && ch != delim)
    {
    if (num)
    {
    if ('0' <= ch <= '9')
    {
    id = (id * 10) + (ch - '0');
    }
    else
    {
    num = false;
    }
    }
    }
    if (num && IsPlayerConnected(id))
    {
    setarg(paramPos, 0, id);
    }
    else
    {
    #if !defined foreach
    #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
    #define __SSCANF_FOREACH__
    #endif
    string[end] = '\0';
    num = false;
    new
    name[MAX_PLAYER_NAME];
    id = end - stringPos;
    foreach (Player, playerid)
    {
    GetPlayerName(playerid, name, sizeof (name));
    if (!strcmp(name, string[stringPos], true, id))
    {
    setarg(paramPos, 0, playerid);
    num = true;
    break;
    }
    }
    if (!num)
    {
    setarg(paramPos, 0, INVALID_PLAYER_ID);
    }
    string[end] = ch;
    #if defined __SSCANF_FOREACH__
    #undef foreach
    #undef __SSCANF_FOREACH__
    #endif
    }
    stringPos = end;
    }
    case 's', 'z':
    {
    new
    i = 0,
    ch;
    if (format[formatPos])
    {
    while ((ch = string[stringPos++]) && ch != delim)
    {
    setarg(paramPos, i++, ch);
    }
    if (!i)
    {
    return -1;
    }
    }
    else
    {
    while ((ch = string[stringPos++]))
    {
    setarg(paramPos, i++, ch);
    }
    }
    stringPos--;
    setarg(paramPos, i, '\0');
    }
    default:
    {
    continue;
    }
    }
    while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
    {
    stringPos++;
    }
    while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
    {
    stringPos++;
    }
    paramPos++;
    }
    do
    {
    if ((delim = format[formatPos++]) > ' ')
    {
    if (delim == '\'')
    {
    while ((delim = format[formatPos++]) && delim != '\'') {}
    }
    else if (delim != 'z')
    {
    return delim;
    }
    }
    }
    while (delim > ' ');
    return 0;
    }


    das unter OnPlayerCommandText:


    dcmd(freezeplayerfor5seconds, 23, cmdtext);


    ausm kopf geschrieben kann aber klappen xD

    if (strcmp("/derby", cmdtext, true) == 0)
    {
    if (JoinDerby[playerid]==true)
    {
    SendClientMessage(playerid,0x00FF00AA, "Welcome in the Derby Arena");
    SetPlayerPos(playerid,-1394.20, 987.62, 1023.96);
    SetPlayerInterior(playerid,15);
    GivePlayerMoney(playerid,-500);
    InDerby[playerid]=true;
    }
    else
    {
    if (JoinDerby[playerid]==false)
    {
    SendClientMessage(playerid,0x00FF00AA, "There is no Derby Event at the moment");
    }
    return 1;
    }


    so denke ich mal ^^