SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Romānă/Romanian

Reply
 
Thread Tools Display Modes
Old 27/01/2017, 11:12 AM   #1
AndreiWow
Gangsta
 
AndreiWow's Avatar
 
Join Date: Nov 2014
Location: Romania, Bucharest
Posts: 909
Reputation: 30
Default Cineva bun la INI?

Este cineva aici care se pricepe la INI? Vreau sa incarc niste masini din scriptfiles si nu stiu cum, va arat ce am facut pana acum daca este cineva care stie..
__________________
You can request small scripts for FREE or ask questions, click the link below

http://samp-support.com/
This is not affiliated with official SA:MP website!
AndreiWow is online now   Reply With Quote
Old 27/01/2017, 12:08 PM   #2
edyun
Big Clucker
 
Join Date: Sep 2014
Posts: 61
Reputation: 3
Default Re: Cineva bun la INI?

Te ajut eu,incarca enumeratiile undeva
edyun is offline   Reply With Quote
Old 27/01/2017, 02:34 PM   #3
AndreiWow
Gangsta
 
AndreiWow's Avatar
 
Join Date: Nov 2014
Location: Romania, Bucharest
Posts: 909
Reputation: 30
Default Re: Cineva bun la INI?

Deci, asta am in script:

Code:
#define MAXPVEHS 100
#define VEH_PATH "Vehicles/%d.ini"

Code:
enum vInfo
{
    Owner,
    Type,
    Float:Pos_x,
    Float:Pos_y,
    Float:Pos_z,
    Float:Rot,
    Color1,
    Color2
}
new VehicleInfo[MAX_PLAYERS][vInfo];

OnGamemodeInit
Code:
for(new i=0; i<MAXPVEHS; i++)
	{
           if(fexist(VehPth(i)))
		{
	    	INI_ParseFile(VehPth(i), "LoadVehicles", .bExtra = true, .extra = i);
	    	CreateVehicle(VehicleInfo[i][Type], VehicleInfo[i][Pos_x], VehicleInfo[i][Pos_y], VehicleInfo[i][Pos_z], VehicleInfo[i][Rot], VehicleInfo[i][Color1], VehicleInfo[i][Color2], 10000);
	    	SetVehicleNumberPlate(i, VehicleInfo[i][Owner]);
 		}
    }
Functia
Code:
LoadVehicles(vehid,name[],value[])
{
    INI_String("Owner", VehicleInfo[vehid][Owner], MAX_PLAYER_NAME);
    INI_Int("Type",VehicleInfo[vehid][Type]);
    INI_Float("Pos_x", VehicleInfo[vehid][Pos_x]);
    INI_Float("Pos_y", VehicleInfo[vehid][Pos_y]);
    INI_Float("Pos_z", VehicleInfo[vehid][Pos_z]);
    INI_Float("Rot", VehicleInfo[vehid][Rot]);
    INI_Int("Color1",VehicleInfo[vehid][Color1]);
    INI_Int("Color2",VehicleInfo[vehid][Color2]);
    return 1;
}


Asta am in scriptfiles

Fila se numeste 5.ini
Code:
[VehicleDATA]
Color1 = 3
Color2 = 2
Pos_x = 1451.5201
Pos_y = -1147.0914
Pos_z = 23.6433
Rot = 154.2415
Type = 462
Owner =


Am folosit comanda asta sa salvez vehiculul
Code:
CMD:saveveh(playerid, vehicleid){
    vehicleid = GetPlayerVehicleID(playerid);
    VehicleInfo[vehicleid][Type] = GetVehicleModel(vehicleid);
    new INI:File = INI_Open(VehPth(vehicleid));
    INI_SetTag(File, "VehicleDATA");
    INI_WriteInt(File, "Color1", VehicleInfo[vehicleid][Color1]);
    INI_WriteInt(File, "Color2", VehicleInfo[vehicleid][Color2]);
    INI_WriteFloat(File, "Pos_x", VehicleInfo[vehicleid][Pos_x]);
    INI_WriteFloat(File, "Pos_y", VehicleInfo[vehicleid][Pos_y]);
    INI_WriteFloat(File, "Pos_z", VehicleInfo[vehicleid][Pos_z]);
    INI_WriteFloat(File, "Rot", VehicleInfo[vehicleid][Rot]);
    INI_WriteInt(File, "Type", VehicleInfo[vehicleid][Type]);
    INI_WriteString(File, "Owner", VehicleInfo[vehicleid][Owner]);
    INI_Close(File);

    return 1;
}

Si a functionat, s-a salvat dar cand pornesc serverul nu creaza vehiculele salvate... si nu inteleg de ce.
__________________
You can request small scripts for FREE or ask questions, click the link below

http://samp-support.com/
This is not affiliated with official SA:MP website!
AndreiWow is online now   Reply With Quote
Old 28/01/2017, 10:02 AM   #4
edyun
Big Clucker
 
Join Date: Sep 2014
Posts: 61
Reputation: 3
Default Re: Cineva bun la INI?

Si in log-uri nu primesti nici o eroare sau ceva?Ar fi folositoare si log-urile pe aici.
edyun is offline   Reply With Quote
Old 06/02/2017, 10:56 AM   #5
POL_george
Gangsta
 
POL_george's Avatar
 
Join Date: Feb 2012
Posts: 506
Reputation: 7
Default Re: Cineva bun la INI?

Incearca cu dini. Sau gini.
__________________
Cand viata iti da lamai, faci portocale!

When live give you lemons, make oranges!
POL_george is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stie cineva? norton2 Romānă/Romanian 3 11/10/2013 01:21 PM
Ma ajuta cineva? POL_george Romānă/Romanian 4 25/03/2012 07:54 PM
Ma ajuta cineva pls? MrS Romānă/Romanian 1 28/10/2010 03:15 PM


All times are GMT. The time now is 09:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.