[Pomoc] Dini + GetPlayerID(osobna vozila)

Započeo LuKsA
8. Okt. 2010.
908
pregleda
4
postova
GGC
5
Godfather
8. Okt. 2010.
Dakle radim osobna vozila, vec sam sve napravio, osim jedne stvari, osiguranja i da se osiguranja oduzimaju, znaci: Npr. vozilo ima 1 osiguranje, netko unisti vozilo, oduzme se 1 osiguranje i vozilu ostane 0 osiguranja, ako onda netko unisti(vozilo izgori, padne u more ili slicno), tada se vozilo jednostavno brise od tog igraca, znaci evo sta sam dosad napravio:
public OnVehicleDeath(vehicleid, killerid)
{
   if(VehicleInfo == 1)
{
   if(VehicleInfo == 0)
   {
       new string[MAX_PLAYER_NAME+75];
new plname;
plname = VehicleInfo;
format(string, sizeof(string), "Vehicles/Vehicles/%s.%s.cfg", plname, VehicleNames[GetVehicleModel(vehicleid)-400]);
new str[MAX_PLAYER_NAME+50];
format(str, sizeof(str), "%s.%s", plname, VehicleNames[GetVehicleModel(vehicleid)-400]);
                 new i2 = GetPlayerID(plname);
if(strfind(str, PlayerVehicle, true) == 0)
{
//SetVehicleToRespawn(vehicleid);
DestroyVehicle(vehicleid);
veh1 = 999; veh2 = 999; veh3 = 999; veh4 = 999; veh5 = 999;
dini_Remove(string);
strmid(PlayerVehicle, "None", 0, strlen("None"), 255);
format(str, sizeof(str), "Vehicles/Players/%s.cfg", plname);
dini_Set(str, "Vehicle1", PlayerVehicle);
SendClientMessage(i2, COLOR_GREEN, "Vase vozilo je unisteno zauvijek, zbog nedostataka osiguranja");
return 1;
}
    }
   else
   {
       VehicleInfo -= 1;
   }
   }
   return 1;
}

stock GetPlayerID(const Name[])
{
   for(new i; i    {
     if(IsPlayerConnected(i))
     {
       new pName;
       GetPlayerName(i, pName, sizeof(pName));
       if(strcmp(Name, pName, true)==0)
       {
         return i;
       }
     }
   }
   return -1;
}


Auto se unisti, insurance se ne oduzme, kao ni ne posalje igracu poruku.. Pa zato pomoc.

Molim da se oni koji se ne razumiju u DINI i slicno ne uplicu u ovu temu, hvala.
Ivex
4
Enforcer
8. Okt. 2010.
ID vjerojatno nisi dobio  zobg ovog
 plname = VehicleInfo;

Koristi strmid ili format !
taft
5
Underboss
8. Okt. 2010.
strmid je brzi i bolji
GGC
5
Godfather
8. Okt. 2010.
A da.. joj nisam ni skuzio, probat cu sad pa vam javim 🙂.. hvala

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha