-
Sziasztok olyan kis \"Kódra\" lenne szükségem, hogy pl ha lehívok egy jármüvet akkor egy 3d-s textet
ír ki a lehívott kocsira, hogy PL: Miska Lehívott Jármüve!
Jármülehívó kód nemkell, az van!
csak az kell, amit az elöbbiekben leírtam!
(Köszi mindenkinek!)
-
Lehet túlbonyolítottam vagy elírtam valamit, de nem teszteltem. Elvileg jónak kell lennie, de hát nem biztos ez. :slap:
new Text3D:kocsitext[MAX_VEHICLES],kocsi[MAX_PLAYERS];
new string[512];
kocsitext[kocsi[playerid]] = Create3DTextLabel(\"Kecske autója\", 0x005effFF,0,0,0, 50, 0, 0);
format(string,sizeof(string),\"%s járműve\",Nev(playerid));
Update3DTextLabelText(kocsitext[kocsi[playerid]] , 0x005effFF, string);
Attach3DTextLabelToVehicle( kocsitext[ kocsi[playerid] ] , kocsi[playerid], 0.0, 0.0, 1.0);
kocsi[playerid] = //lehívott kocsi...
stock Nev(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
-
Köszi a kódot, de van 1 probléma :$
nem jelzi ki a textet a kocsi(n)
-
Hogy van a kocsilehívó kód?
kocsi[playerid] = CreateVehicle(.......);
valahogy így kellene kinéznie.
-
CMD:v(playerid,params[])
{
new modelname[64], color[2], carid;
if(sscanf(params, \"s[64]D(127)D(127)\", modelname, color[0], color[1])) return SendClientMessage(playerid, COLOR_RED, \"HASZNÁLAT: /v [Model ID/Név] [szín 1] ( [szín 2] )\");
if(!IsNumeric(modelname))
{
carid = GetVehicleModelIDFromName(modelname);
}
else
{
carid = strval(modelname);
}
if(carid < 400 || carid > 611) return SendClientMessage(playerid, COLOR_RED, \"\"RED\"Hiba \"WHITE\"- \"GREY\"Sajnálom, De Ilyen Jármü Nem Létezik!\");
if(color[0] < 0 || color[0] > 127) return SendClientMessage(playerid, COLOR_RED, \"\"RED\"Hiba \"WHITE\"- \"GREY\"Rossz Szín ID! < 0 - 126 >\");
if(color[1] < 0 || color[1] > 127) return SendClientMessage(playerid, COLOR_RED, \"\"RED\"Hiba \"WHITE\"- \"GREY\"Rossz Szín ID! < 0 - 126 >\");
if(color[0] == 127) color[0] = random(126);
if(color[1] == 127) color[1] = random(126);
if(GetPVarInt(playerid, \"pCar\") != INVALID_VEHICLE_ID && !IsPlayerAdmin(playerid)) CarDeleter(GetPVarInt(playerid, \"pCar\"));
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
SetPVarInt(playerid, \"pCar\", CreateVehicle(carid, X, Y, Z, Angle, color[0], color[1], -1));
LinkVehicleToInterior(GetPVarInt(playerid, \"pCar\"), GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPVarInt(playerid, \"pCar\"), GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, GetPVarInt(playerid, \"pCar\"), 0);
format(i_str, sizeof(i_str), \"~w~Spawnoltál Egy Járművet: ~y~~h~%s~w~, ~y~~h~Model: %d~w~\", VehicleNames[carid - 400], carid);
dws(playerid, i_str);
return 1;
}
Így néz ki a kocsi lehívó parancs
-
kocsi[playerid] = SetPVarInt(playerid, \"pCar\", CreateVehicle(carid, X, Y, Z, Angle, color[0], color[1], -1));
Próbáld így. Talán jó lesz.
Vagy nem tudom így engedni fogja-e, mert sosem próbáltam:
SetPVarInt(playerid, \"pCar\", kocsi[playerid] = CreateVehicle(carid, X, Y, Z, Angle, color[0], color[1], -1));
-
Nincs semmi baj, én voltam a szerencsétlen, mivel kihagytam az alábbi kódot a /v parancsból xdddd
Amit kihagytam :laugh:
new string[512];
kocsitext[kocsi[playerid]] = Create3DTextLabel(\"Kecske autója\", 0x005effFF,0,0,0, 50, 0, 0);
format(string,sizeof(string),\"%s járműve\",Nev(playerid));
Update3DTextLabelText(kocsitext[kocsi[playerid]] , 0x005effFF, string);
Attach3DTextLabelToVehicle( kocsitext[ kocsi[playerid] ] , kocsi[playerid], 0.0, 0.0, 1.0);