Help me! string promblem!
#1

HELLO!
How to make:
Код:
VehInfo[vehid][Model] = namev
namev to Name Of Vehicle?
Full Code:
Код:
public mymakepersonal(playerid)
{
    new name5[MAX_PLAYER_NAME], namev;
    GetPlayerName(playerid, name5, sizeof(name5));
    new vehid = GetPlayerVehicleID(playerid);
    new string2[185];
    VehInfo[vehid][Cumparata] = 1;
    namev = VehicleNames[GetVehicleModel(vehid)-400];
	AccountInfo[playerid][Vehicule]++;
 	strmid(VehInfo[vehid][Propietar], name5, 0, strlen(name5), 999);
	TogglePlayerControllable(playerid, 1); SaveThisCar(vehid);
	GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /park!", 5000, 3);
	SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari ti-ai cumparat o masina noua!");
	format(string2, sizeof(string2), " Propietar: %s \n Model: %s",VehInfo[vehid][Propietar], GetVehicleName(vehid));
	Attach3DTextLabelToVehicle( vtextlabel[vehid] , vehid, 0.0, 0.0, 0.0);
	Update3DTextLabelText(vtextlabel[vehid], 0xFF4500FF, string2);
	new Float:x, Float:y, Float:z, Float:Angle;
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, Angle);
	VehInfo[vehid][Model] = namev;
    VehInfo[vehid][Locatiex] = 2149.1016;  VehInfo[vehid][Locatiey] = -1133.6986; VehInfo[vehid][Locatiez] = 25.5670; VehInfo[vehid][Rotatie]= 265.1599;
    SetPlayerFacingAngle(playerid, Angle); SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, Angle);
    SaveThisCar(vehid);
}
For Get name of vehicle:
Код:
VehicleNames[GetVehicleModel(vehid)-400]
+1 for help!
Sorry for my bad english...
Reply
#2

namev = GetVehicleModel(vehicleid)-400];
Do you mean that?
Reply
#3

use format to write a string for ex:
PHP код:
format(namev,sizeof(namev),"%s",VehInfo[vehid][Model]); 
but here's the deal i dont think this will return the vehicle's name so i suggest you use this Include
Reply
#4

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
i dont think this will return the vehicle's name so i suggest you use this Include
They may already be using https://github.com/AbyssMorgan/SA-MP...de/SAM/EVF.inc ...

https://sampforum.blast.hk/showthread.php?tid=611142
Reply
#5

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
SOLVED!

Thanks!
You Give Rep+1!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)