SA-MP Forums Archive
How can i else better use it? - 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: How can i else better use it? (/showthread.php?tid=156967)



How can i else better use it? - Ihsan_Cingisiz - 24.06.2010

Hello, i made a script for detecting in which vehicle the player
goes in. But i have a little problem, if i do 'If model not is ID 509 (Bike)'
then 'SendClientMessage : You don't have driving license' and if you enter
a helicopter, that not id 509 too, and i get that message too,, Here's my
script what can i better do?
Quote:

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new model;
model = GetVehicleModel(vehicleid);
if(model != 509 && model != 481 && model != 510) {
if(pDLic[playerid] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);

SendClientMessage(playerid, COLOR_LRED, "** You don't have a driving license yet, please get your Driving license at the DMV.");
return 1;
}

}
if(model == 548 && model == 425 && model == 417 && model == 487 && model == 488 && model == 497 && model == 563 && model == 447 && model == 469) {
if(pFLic[playerid] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);

SendClientMessage(playerid, COLOR_LRED, "** You don't have a flying license yet, please get your Flying license at the DMV.");
return 1;
}
}
if(model == 472 && 473 && 493 && 595 && 484 && 430 && 453 && 452 && 446 && 454) {
if(pSLic[playerid] == 0) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);

SendClientMessage(playerid, COLOR_LRED, "** You don't have a sailing license yet, please get your Sailing license at the DMV.");
return 1;
}
}
return 1;
}





Re: How can i else better use it? - Anthony_Brassi - 24.06.2010

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  new model = GetVehicleModel(vehicleid);
  if(model != 509 || model != 481 || model != 510) {
   if(pDLic[playerid] == 0) {
     new Float:X, Float:Y, Float:Z;
     GetPlayerPos(playerid, X, Y, Z);
     SetPlayerPos(playerid, X, Y, Z);
     
     SendClientMessage(playerid, COLOR_LRED, "** You don't have a driving license yet, please get your Driving license at the DMV.");
      return 1;
   }

   }
  if(model == 548 || model == 425 || model == 417 || model == 487 || model == 488 || model == 497 || model == 563 || model == 447 || model == 469) {
   if(pFLic[playerid] == 0) {
     new Float:X, Float:Y, Float:Z;
     GetPlayerPos(playerid, X, Y, Z);
     SetPlayerPos(playerid, X, Y, Z);
     
     SendClientMessage(playerid, COLOR_LRED, "** You don't have a flying license yet, please get your Flying license at the DMV.");
      return 1;
   }
   }
   if(model == 472 || 473 || 493 || 595 || 484 || 430 || 453 || 452 || 446 || 454) {
    if(pSLic[playerid] == 0) {
     new Float:X, Float:Y, Float:Z;
     GetPlayerPos(playerid, X, Y, Z);
     SetPlayerPos(playerid, X, Y, Z);

      SendClientMessage(playerid, COLOR_LRED, "** You don't have a sailing license yet, please get your Sailing license at the DMV.");
      return 1;
     }
  }
   return 1;
}



Re: How can i else better use it? - Kar - 24.06.2010

dont use onplayerenter vehicle

if u press enter to go in a vehicle and you dont actually go in it will send the message lol