Hi! First sorry for my bad English, I am from Austria. I wanted to script a script in which the car teleports to a special point when, the player is in it and in the near of an artict (CMD = "/beladen"). But the vehicle position is only set for the player who was writting the command. Is this an bug or have I scripted shit? Here is a part of the script:
Код:
if (strcmp("/beladen", cmdtext, true) == 0)
{
if (!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xFF0000FF, "Du musst in dem Wagen sitzen den du aufladen willst!");
return 1;
}
new artict=GetClosestArtict(playerid);
new vehicle=GetPlayerVehicleID(playerid);
new Float:dist1=GetDistanceToVehicle(playerid, artict);
new modelid=GetVehicleModel(vehicle);
printf("%d %d",vehicle,artict);
if (dist1>18)
{
SendClientMessage(playerid, 0xFF0000FF, "Anhдnger zu weit weg!");
return 1;
}
if (modelid==403||modelid==515||modelid==584)
{
SendClientMessage(playerid, 0xFF0000FF, "Du kannst keine LKWs einladen!");
return 1;
}
new filename[64];
format(filename,64,"Artict%d.txt",artict);
if (dini_Exists(filename))
{
if (dini_Int(filename,"autos")==3)
{
SendClientMessage(playerid, 0xFF0000FF, "Der Anhдnger ist bereits voll!");
return 1;
}
dini_IntSet(filename,"autos",dini_Int(filename,"autos")+1);
new autoname[28];
format(autoname,28,"auto%d",dini_Int(filename,"autos"));
dini_IntSet(filename,autoname,vehicle);
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetVehiclePos(vehicle,0,0,20);
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SendClientMessage(playerid, 0x00FF00FF, "Auto erfolgreich eingeladen!");
return 1;
}