Car Problem
#1

Код:
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.
Reply
#2

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

still doesnt work
Reply
#4

where is this little code snippet in? OnPlayerEnterVehicle? OnPlayerStateChange?
Reply
#5

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

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");
}
Reply
#7

still nothing
Reply
#8

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);
}
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)