SA-MP Forums Archive
SendClientMessage not working... - 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: SendClientMessage not working... (/showthread.php?tid=335714)



SendClientMessage not working... - Gooday - 19.04.2012

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 499)
     {
         SendClientMessage(playerid, COLOR_RED, "(INFO) You can start drug smuggler missions by typing /Courrier.");
     }
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
     {
         SendClientMessage(playerid, COLOR_RED, "(INFO) You can start the sweeping job by using /Sweeper.");
     }
     return 1;
}
When I enter a vehicle it doesn't show the message... Why?


Re: SendClientMessage not working... - ViniBorn - 19.04.2012

Try
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(vehicleid) == 499)
     {
         SendClientMessage(playerid, COLOR_RED, "(INFO) You can start drug smuggler missions by typing /Courrier.");
     }
     if(GetVehicleModel(vehicleid) == 574)
     {
         SendClientMessage(playerid, COLOR_RED, "(INFO) You can start the sweeping job by using /Sweeper.");
     }
     return 1;
}



Re: SendClientMessage not working... - Gooday - 19.04.2012

Thanks, It worked.


Re: SendClientMessage not working... - [MG]Dimi - 19.04.2012

The point why your didn't is that OnPLayerEnterVehiocle is called when he presses F near car, not when he is in car. So thing is that his Vehicle ID is -1. Hope you understood.