Reserved Vehicle ( Another of those topic ey )
#1

So i seriously got confused , every prob i found or tut was for one person. so i tried something and well i failed . The cars either wont detect my name or even not work lol



Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT
new mygate;
new Baio;
new Baio1;
new Baio2;
new Baio3;
new Baio4;
new Baio5;
new Baio6;
new Baio7;

new myhangar;

forward close();

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" New Area 51 V2 by sergio Loaded");
	print("--------------------------------------\n");
	 mygate = CreateObject(10828,1402.02685547,1798.57189941,22.12156677,0.00000000,0.00000000,43.66979980); //object(drydock1_sfse) (1) gateeeeeeeee
     myhangar = CreateObject(3491,1383.13818359,1819.36621094,18.36563110,0.00000000,0.00000000,43.66979980); //object(vegass_hanger2) (1)

     Baio = CreateVehicle(519,1372.82482910,1832.16442871,11.82038498,225.02099609,126,126,60); //Shamal
     Baio1 = CreateVehicle(451,1391.29760742,1834.97985840,10.58468437,162.76922607,126,126,60); //Turismo
     Baio2 = CreateVehicle(451,1395.02050781,1832.15856934,10.58468437,162.76788330,126,126,60); //Turismo
     Baio3 = CreateVehicle(451,1399.01220703,1829.54418945,10.58468437,162.76245117,126,126,60); //Turismo
     Baio4 = CreateVehicle(506,1369.71240234,1810.68078613,10.61242580,278.61560059,126,126,60); //Super GT
     Baio5 = CreateVehicle(541,1371.25866699,1805.95056152,10.52031231,288.54052734,126,126,60); //Bullet
     Baio6 = CreateVehicle(411,1373.24182129,1801.64672852,10.62031269,294.49548340,126,126,60); //Infernus
     Baio7 = CreateVehicle(411,1375.06201172,1798.28393555,10.62031269,294.49401855,126,126,60); //Infernus

	return 1;
}

public OnFilterScriptExit()
{

	 DestroyObject(mygate); //object(drydock1_sfse) (1) gateeeeeeeee
     DestroyObject(myhangar); //object(vegass_hanger2) (1)
   	 DestroyObject(mygate); //object(drydock1_sfse) (1) gateeeeeeeee
     DestroyObject(myhangar); //object(vegass_hanger2) (1)
     
	 DestroyVehicle(Baio);
	 DestroyVehicle(Baio1);
	 DestroyVehicle(Baio2);
     DestroyVehicle(Baio3);
	 DestroyVehicle(Baio4);
     DestroyVehicle(Baio5);
	 DestroyVehicle(Baio6);
	 DestroyVehicle(Baio7);
	 	 	 	 	 	 
	 return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" New Area 51 v2 by sergio Unloaded");
	print("----------------------------------\n");
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{

    if(strcmp("/seesamavane", cmdtext, true) == 0)
	{
		MoveObject(mygate,1402.02685547,1798.57189941,30.12156677,2.00);
	    SetTimer("close", 7000, 0);//gate will be  closed for 7 seconds
		return 1;
	}
	     if(strcmp(cmdtext, "/destroyveh", true) == 0)
     {
          new currentveh;
          currentveh = GetPlayerVehicleID(playerid);
          DestroyVehicle(currentveh);
          return 1;
     }
	
	return 0;
}

public close()
{
    MoveObject(mygate,1402.02685547,1798.57189941,22.12156677,3.00);
    return 1;
}



public OnPlayerStateChange(playerid, newstate, oldstate)
{
  new PlayerName[24];
  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  if(newstate == PLAYER_STATE_DRIVER)
  {
   new Vehicle = GetPlayerVehicleID(playerid);
   if(Vehicle == Baio || Vehicle == Baio1 || Vehicle == Baio2 || Vehicle == Baio3 || Vehicle == Baio4 || Vehicle == Baio5 || Vehicle == Baio6 || Vehicle == Baio7)
   {
    if(strcmp(PlayerName,"Intsu",true) || (PlayerName,"CreepyMoto",true) == 0) // there was unecessary ";" and "if" statement here
     {
	   return 1;
     }
     else
	 {
	  RemovePlayerFromVehicle(playerid);
      SendClientMessage(playerid, 0x33AA33AA, "I'm sorry, but this car has been reserved for CreepyMoto / Intsu");
	 }
   }
  }
  return 1;
}

PS! : Dont mind the weird stuff there like area 51 , i just installed mine over other FS i had XD
Reply
#2

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new PlayerName[24];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new Vehicle = GetPlayerVehicleID(playerid);
       
        if(Vehicle == Baio || Vehicle == Baio1 || Vehicle == Baio2 || Vehicle == Baio3 || Vehicle == Baio4 || Vehicle == Baio5 || Vehicle == Baio6 || Vehicle == Baio7)
        {
            if(strcmp("Intsu", PlayerName, true) != 0 || strcmp("CreepyMoto", PlayerName, true) != 0)  RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, 0x33AA33AA, "I'm sorry, but this car has been reserved for CreepyMoto / Intsu");
        }
    }
    return 1;
}
Reply
#3

E:\TEST\another test\missel.pwn(112) : error 017: undefined symbol "name"


.....
Reply
#4

Maybe change
if(strcmp("Intsu", name, true) != 0 || strcmp("CreepyMoto", name, true) != 0)
to
if(strcmp("Intsu", PlayerName, true) != 0 || strcmp("CreepyMoto", PlayerName, true) != 0)
Reply
#5

I did already , i noticed that after i posted XD , it aint working still . I tried with only one name , and it worked . But with 2 names it fails
Reply
#6

nvm*......................................
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)