hey
ich wollte euch mal fragen wie ich das machen kann das nur leute mit dem skin 285 & 221 ein auto fahren können.
also nur die leute mit dem skin 285 & 221 können den infernus fahren !
wie geht das ? ;D
MFG
Cars + Skins !
- BlackM !!
- Geschlossen
- Erledigt
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
-
-
Das kannst Du mit einer einfach if Anweisung
tun, in der Du einfach die Skin ID des Spielers abfragst.new playerskin = GetPlayerSkin(playerid);
if(playerskin == DEINE_SKIN_ID)
{
...
} -
das geht nicht ich habe das so
new playerskin = GetPlayerSkin();
if(playerskin == 285)
if(playerskin == 221)
{
AddStaticVehicleEx(520,1384.50244141,-2423.25488281,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1373.33398438,-2422.79980469,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1395.49658203,-2422.93261719,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1406.24084473,-2422.61767578,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1416.73571777,-2422.31005859,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1426.98034668,-2422.00927734,14.47426319,0.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(425,1450.54614258,-2438.96337891,14.40568733,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1438.04187012,-2438.92041016,14.40568733,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1438.33911133,-2457.41992188,14.40568733,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1449.83886719,-2457.22900391,14.40568733,0.00000000,-1,-1,15); //Hunter}
if(playerskin == 285)
if(playerskin == 221)
{
AddStaticVehicleEx(425,1892.66662598,-2270.03930664,14.39787483,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1903.41601562,-2269.82910156,14.39787483,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1913.66601562,-2269.62890625,14.39787483,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(425,1923.91601562,-2269.42871094,14.39787483,0.00000000,-1,-1,15); //Hunter
AddStaticVehicleEx(520,1924.24707031,-2290.59594727,14.46645069,180.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1913.48510742,-2290.57910156,14.46645069,180.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1934.82922363,-2290.62060547,14.46645069,180.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1945.59106445,-2290.63671875,14.46645069,180.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1957.09082031,-2290.36987305,14.46645069,180.00000000,-1,-1,15); //Hydra
AddStaticVehicleEx(520,1968.35229492,-2290.36328125,14.46645069,180.00000000,-1,-1,15); //Hydra
}
if(playerskin == 287)
if(playerskin == 142)
{
AddStaticVehicleEx(432,1458.85632324,-2424.85424805,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1465.60546875,-2424.82714844,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1472.35546875,-2424.80078125,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1478.85546875,-2424.77539062,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1485.85546875,-2424.74804688,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(433,1450.53930664,-2413.01562500,14.12468719,0.00000000,-1,-1,15); //Barracks
AddStaticVehicleEx(433,1445.03906250,-2413.03710938,14.12468719,0.00000000,-1,-1,15); //Barracks
AddStaticVehicleEx(433,1439.03906250,-2413.06054688,14.12468719,0.00000000,-1,-1,15); //Barracks
}
if(playerskin == 287)
if(playerskin == 142)
{
AddStaticVehicleEx(432,1886.87194824,-2307.28125000,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1892.64172363,-2307.25146484,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1898.66113281,-2307.19824219,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1886.90270996,-2296.72998047,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1892.87597656,-2296.17871094,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1899.09851074,-2295.60498047,13.64621162,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(432,1492.26013184,-2424.19946289,13.65402412,0.00000000,-1,-1,15); //Rhino
AddStaticVehicleEx(433,1897.87463379,-2315.47412109,14.11687469,272.00000000,-1,-1,15); //Barracks
AddStaticVehicleEx(433,1898.00842285,-2325.73120117,14.11687469,271.99951172,-1,-1,15); //Barracks
AddStaticVehicleEx(433,1898.19494629,-2320.48559570,14.11687469,271.99951172,-1,-1,15); //Barracks
} -
das kan nicht funktionieren du machst ja 2 abfragen aufeinmal und beantwortest nur eine.
probier mal so
new playerskin = GetPlayerSkin();
if(playerskin == 285 playerskin == 221)
{
AddStaticVehicleEx(520,1384.50244141,-2423.25488281,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1373.33398438,-2422.79980469,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1395.49658203,-2422.93261719,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1406.24084473,-2422.61767578,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1416.73571777,-2422.31005859,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1426.98034668,-2422.00927734,14.47426319,0.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(425,1450.54614258,-2438.96337891,14.40568733,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1438.04187012,-2438.92041016,14.40568733,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1438.33911133,-2457.41992188,14.40568733,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1449.83886719,-2457.22900391,14.40568733,0.00000000,-1,-1,15); //Hunter
}
if(playerskin == 285 playerskin == 221)
{
AddStaticVehicleEx(425,1892.66662598,-2270.03930664,14.39787483,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1903.41601562,-2269.82910156,14.39787483,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1913.66601562,-2269.62890625,14.39787483,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(425,1923.91601562,-2269.42871094,14.39787483,0.00000000,-1,-1,15); //Hunter AddStaticVehicleEx(520,1924.24707031,-2290.59594727,14.46645069,180.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1913.48510742,-2290.57910156,14.46645069,180.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1934.82922363,-2290.62060547,14.46645069,180.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1945.59106445,-2290.63671875,14.46645069,180.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1957.09082031,-2290.36987305,14.46645069,180.00000000,-1,-1,15); //Hydra AddStaticVehicleEx(520,1968.35229492,-2290.36328125,14.46645069,180.00000000,-1,-1,15); //Hydra
}
if(playerskin == 287 playerskin == 142)
{
AddStaticVehicleEx(432,1458.85632324,-2424.85424805,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1465.60546875,-2424.82714844,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1472.35546875,-2424.80078125,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1478.85546875,-2424.77539062,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1485.85546875,-2424.74804688,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(433,1450.53930664,-2413.01562500,14.12468719,0.00000000,-1,-1,15); //Barracks AddStaticVehicleEx(433,1445.03906250,-2413.03710938,14.12468719,0.00000000,-1,-1,15); //Barracks AddStaticVehicleEx(433,1439.03906250,-2413.06054688,14.12468719,0.00000000,-1,-1,15); //Barracks
}
if(playerskin == 287 playerskin == 142)
{
AddStaticVehicleEx(432,1886.87194824,-2307.28125000,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1892.64172363,-2307.25146484,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1898.66113281,-2307.19824219,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1886.90270996,-2296.72998047,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1892.87597656,-2296.17871094,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1899.09851074,-2295.60498047,13.64621162,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(432,1492.26013184,-2424.19946289,13.65402412,0.00000000,-1,-1,15); //Rhino AddStaticVehicleEx(433,1897.87463379,-2315.47412109,14.11687469,272.00000000,-1,-1,15); //Barracks AddStaticVehicleEx(433,1898.00842285,-2325.73120117,14.11687469,271.99951172,-1,-1,15); //Barracks AddStaticVehicleEx(433,1898.19494629,-2320.48559570,14.11687469,271.99951172,-1,-1,15); //Barracks
} -
ja die cars werden nicht angezeigt .
was muss ich machen -
Wo machst du die Abfrage?
Weil du erstellst damit Autos o.ô -
public OnGameModeInit()
-
ja bei mir ist das das gleiche
-
Arbeitsest du mit dini? Wenn ja kannst du in den Accounts den skin speichern lassen. Dann definest du oben im script z.b new infernus[10]; . Dann setzt du vor die Autos die nur skin ID (skinid) fahren darf : : infernus[0]=AddStatic..... Das machst du bei allen autos so die du willst. Du musst abba die variable in den klammern immer um 1 erhohen dann musst du bei OnPlayerStateChange eingeben, dass alle skin (skinid) haben einsteigen können. Hat jemand nicht diese ID, wird er aus dem fahrzeug geworfen. Die abfrage könnte so aussehen: if(isPlayerSkin(playeridnskinid))
{
...
return 1;
}Viel Glück. Wenn du das nicht schaffst, poste ich morgen das ganze drunter. Das kannst du dann einfugen ins script und nachmachen.
Bei errors oder fragen poste es hier oder schreib ne PN ;DMfg
-
Ist doch klar, du fragst bei OnGameModeInIt den Skin ab, Sinn?
Woher soll das Script denn wissen, wessen Skin gemeint ist? Das würde eher bei OnPlayerSpawn Sinn machen. -
mach es doch ganz einfach bei ongamemode erstellst du die cars
dann wenn einer ins auto einsteigt sprich
Onplayerentervehicle machst du das sollte funktionieren ist aber ungetestet wenn du noch weiterhin probleme hast kannste dich ja per pn melden. -
breadfish.de
Hat das Thema geschlossen.