SA-MP Forums Archive
Vehicle Entering Messages - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle Entering Messages (/showthread.php?tid=496583)



Vehicle Entering Messages - ZBits - 22.02.2014

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


Re: Vehicle Entering Messages - Abagail - 22.02.2014

What's MAX_VCARS? Why not use MAX_VEHCICLES?


Re: Vehicle Entering Messages - ZBits - 22.02.2014

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


Re: Vehicle Entering Messages - Brandon_More - 22.02.2014

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



Re: Vehicle Entering Messages - ZBits - 22.02.2014

Now it just gives every car a ID of 999


Re: Vehicle Entering Messages - ZBits - 22.02.2014

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


Re: Vehicle Entering Messages - ZBits - 23.02.2014

Still need help on this


Re: Vehicle Entering Messages - MattTucker - 23.02.2014

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],



Re: Vehicle Entering Messages - ZBits - 24.02.2014

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


Re: Vehicle Entering Messages - CJay9209 - 25.02.2014

what script are you using?