Fraktions Auto

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
  • Hi


    ich suche einen code für fraktions autos..


    also es sollte so sein,
    ich speicher meine fraktionen in dini..


    also bräuchte ich


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    if(Spieler[playerid][Cop]<1 || if(Spieler[playerid][Cop]<2 || if(Spieler[playerid][Cop]<3 || if(Spieler[playerid][Cop]<4 || if(Spieler[playerid][Cop]<5)


    (welche autos)


    (spieler aus dem auto kicken)


    (Message das derjenige kein Cop ist)
    return 1;
    }


    sry bin neu hoffe ihr versteht was ich meine :P.

    ___________________
    ComaCrew


    Gamemode: 25% bis zum 1. Release


    MOD'S GESUCHT!
    LEADER GESUCHT!
    ___________________
    _______

  • okay danke,


    jetzt muss ich nurnoch wissen wie ich bestimmte autos dafür mache ..

    ___________________
    ComaCrew


    Gamemode: 25% bis zum 1. Release


    MOD'S GESUCHT!
    LEADER GESUCHT!
    ___________________
    _______

  • kann das so klappen??


    if(copcar[playerid])


    copcar = AddStaticVehicleEx(596,1601.9766,-1687.7706,5.6101,90.2926,79,1,3600000); // police3
    copcar = AddStaticVehicleEx(596,1601.9766,-1687.7706,5.6101,90.2926,79,1,3600000); // police3

    ___________________
    ComaCrew


    Gamemode: 25% bis zum 1. Release


    MOD'S GESUCHT!
    LEADER GESUCHT!
    ___________________
    _______

    Einmal editiert, zuletzt von core_61 ()

  • forward IsACopCar(vehicleid);


    new copcar[Anzahl der Cars];


    public IsACopCar(vehicleid)
    {
    for(new i = 0; i < sizeof(copcar); i++)
    {
    if(vehicleid == copcar)
    {
    return 1;
    }
    }
    return 0;
    }

  • hmm ..

    error 033: array must be indexed (variable "copcar")


    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(112) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(113) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(114) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(115) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(116) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(117) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(118) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(119) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(120) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(121) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(122) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(123) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(124) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(125) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(126) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(127) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(128) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(634) : error 033: array must be indexed (variable "copcar")
    C:\Dokumente und Einstellungen\ADMIN\Desktop\Server\Samp 0.3\gamemodes\SanAndreasReallife.pwn(644) : warning 203: symbol is never used: "strtok"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    18 Errors.


    zeilen:


    copcar = AddStaticVehicleEx(596,1557.0688,-1606.1843,13.0992,178.2664,79,1,3600000); // police
    copcar = AddStaticVehicleEx(523,1560.9471,-1605.5818,12.9338,178.6069,79,1,3600000); // police1
    copcar = AddStaticVehicleEx(523,1563.2247,-1605.5698,12.9361,178.3233,79,1,3600000); // police2
    copcar = AddStaticVehicleEx(596,1601.9766,-1687.7706,5.6101,90.2926,79,1,3600000); // police3
    copcar = AddStaticVehicleEx(523,1601.6710,-1691.9319,5.4430,88.1373,79,1,3600000); // police4
    copcar = AddStaticVehicleEx(596,1601.8323,-1696.2560,5.6190,90.0286,79,1,3600000); // police5
    copcar = AddStaticVehicleEx(596,1595.3887,-1711.0923,5.6199,358.1154,79,1,3600000); // police6
    copcar = AddStaticVehicleEx(523,1591.4655,-1710.1833,5.4431,357.2161,79,1,3600000); // police7
    copcar = AddStaticVehicleEx(599,1587.3812,-1710.5177,6.1121,359.7622,79,1,3600000); // police8
    copcar = AddStaticVehicleEx(599,1570.3354,-1710.8552,6.1118,359.6860,79,1,3600000); // police9
    copcar = AddStaticVehicleEx(599,1528.4181,-1688.0577,6.1138,270.5905,79,1,3600000); // police11
    copcar = AddStaticVehicleEx(596,1528.4347,-1683.8195,5.6397,269.9776,79,1,3600000); // police13
    copcar = AddStaticVehicleEx(599,1538.6957,-1644.8705,6.1119,180.1589,79,1,3600000); // police14
    copcar = AddStaticVehicleEx(596,1545.8173,-1650.9814,5.6158,89.9410,79,1,3600000); // police15
    copcar = AddStaticVehicleEx(523,1545.6312,-1655.1655,5.4402,90.8472,79,1,3600000); // police16
    copcar = AddStaticVehicleEx(596,1545.5947,-1672.0311,5.6094,88.6282,79,1,3600000); // police17
    copcar = AddStaticVehicleEx(596,1545.6455,-1676.2545,5.6069,90.3089,79,1,3600000); // police18


    if(vehicleid == copcar)

    ___________________
    ComaCrew


    Gamemode: 25% bis zum 1. Release


    MOD'S GESUCHT!
    LEADER GESUCHT!
    ___________________
    _______

  • new copcar[3];


    OnGameModeInit.....


    copcar[0] = ............ // Die 0 ist sogesagt die 1 die musst du mit zählen
    copcar[1] = ............
    copcar[2] = ............



    Hoffe konnt dir damit helfen, und wenn SuFu findest du Tutorials etc.



    MfG


    Shooter1995

  • und ganz wichtig
    unter public OnPlayerStateChange(playerid, newstate, oldstate)
    ganz wichtig



    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(isacopcar(newcar))
    {
    if(isacop(playerid)) { }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_RED, "Du bist kein Polizist");
    }}
    }