SA-MP Forums Archive
Car Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Car Problem (/showthread.php?tid=66050)



Car Problem - CJ101 - 18.02.2009

Код:
if GetPlayerVehicleID(playerid) == 498
*then
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid,37,250);
}
When the player gets in this car, they are supposed to get a flamethrower. But, the game
doesnt do anything when they get in the van.


Re: Car Problem - ICECOLDKILLAK8 - 18.02.2009

pawn Код:
if (GetPlayerVehicleID(playerid) == 498)
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid,37,250);
}



Re: Car Problem - CJ101 - 18.02.2009

still doesnt work


Re: Car Problem - Daren_Jacobson - 18.02.2009

where is this little code snippet in? OnPlayerEnterVehicle? OnPlayerStateChange?


Re: Car Problem - CJ101 - 18.02.2009

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (GetPlayerVehicleID(playerid) == 498)
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid,37,250);
}
OnPlayerEntervehicle


Re: Car Problem - Daren_Jacobson - 18.02.2009

use this and tell me what happens
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
print("hmm");
if (vehicleid == 498)
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid, 37, 250);
}
print("very interesting");
}



Re: Car Problem - CJ101 - 18.02.2009

still nothing


Re: Car Problem - Jefff - 19.02.2009

vehicleid is not ID but Model
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 498)
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid,37,250);
}



Re: Car Problem - ICECOLDKILLAK8 - 19.02.2009

Quote:
Originally Posted by Jefff
vehicleid is not ID but Model
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 498)
{
SendClientMessage(playerid, COLOR_ORANGE, "== Congrats You Found The Weapon Van!");
GivePlayerWeapon(playerid,37,250);
}
How do you know he wants it to be a Model?, He could just want one van and thats it, Try doing this
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "Vehicle ID is: %d", vehicleid);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
Then go in your sever and get in the van and it will tell you the vehicleid, Note it down and check if you are using the right vehicle id