Vehicle Entering Messages
#1

Hello,

I am trying to make this message appear with the correct infomation but it doesnt work.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new id, string[128];
id = GetVehicleModel(GetPlayerVehicleID(playerid));
for(new a; a < MAX_VCARS; a++)
{
format(string, sizeof(string), "You Entered a %s(%d). Owner: %s", VehicleNames[id - 400],sInfo[a][ID],sInfo[a][vOwner]);
}
SendClientMessage(playerid,COLOR_ADMSININE,string);
return 1;
}
}
What this basically is supposed to do is when a player enters a car he gets a message "You have entered a "CArname"(Carid). Owner: "Car Owner"" but it prints out "You Entered a Infernus(0). Owner: " Owner field should display my name but it doesnt and the car id should be 315 but it prints 0
Reply
#2

What's MAX_VCARS? Why not use MAX_VEHCICLES?
Reply
#3

i load my vehicles from a mysql database, so i used MAX_VCARS
Reply
#4

pawn Код:
format(string, sizeof(string), "You Entered a %s(%i). Owner: %s", VehicleNames[id - 400], a, sInfo[a][vOwner]);
Reply
#5

Now it just gives every car a ID of 999
Reply
#6

i tried printing out my sInfo[a][vOwner] variable and it printed as blank
Reply
#7

Still need help on this
Reply
#8

Quote:
Originally Posted by Domnic Toretto
Посмотреть сообщение
i tried printing out my sInfo[a][vOwner] variable and it printed as blank
It might be something of your saving/loading system as "Owner" is a string and on the "sInfo" enum did you use parameters? Like
pawn Код:
vOwner[190],
Reply
#9

i used MAX_PLAYER_NAME before, but i changed to [190] and still no luck,still need help
Reply
#10

what script are you using?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)