Ok, i tryed to do it but when i go in the vehicle it doesnt say the price of the vehicle or its owner..
so here it is as gametext, can you make it into a clientmessage?
the price and owner works as gametext but when i tryed to make it clientmessage it didnt show it like that
here it is as gametext-
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(GetPlayerVehicleID(playerid) >= VCount) return 1;
new car = GetPlayerVehicleID(playerid); new msg[256];
if(newstate==PLAYER_STATE_DRIVER)
{
new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
if(VehicleInfo[car][CarOwned] == 1)
{
if(strcmp(PlayerName,VehicleInfo[car][CarOwner],true) == 0) {
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This is your vehicle",2000,3);
} else {
format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
GameTextForPlayer(playerid,msg,2000,3); }
}
else if(VehicleInfo[car][Buyable] == 0)
{
format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle is not for sell", VehicleInfo[car][CarOwner] );
GameTextForPlayer(playerid,msg,2000,3);
}
else
{
format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This car is for sell Price $%d",VehicleInfo[car][Price]);
GameTextForPlayer(playerid,msg,2000,3);
}
}
if(newstate==PLAYER_STATE_PASSENGER)
{
if(VehicleInfo[car][CarOwned] == 1)
{
format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
GameTextForPlayer(playerid,msg,2000,3);
}
}
return 1;
}