Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new playername[64], count=0;
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- new modelid = GetVehicleModel(vehicleid);
- if(vehicleid == terrortank)
- {
- if(terrortanktimer != 0)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, COLOR_SILVER, "Error: You must wait sometime to use this vehicle again.");
- return 1;
- }
- }
- if(vehicleid == armytank)
- {
- if(armytanktimer != 0)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, COLOR_SILVER, "Error: You must wait sometime to use this vehicle again.");
- return 1;
- }
- }
- if(vehicleid == terrortank || vehicleid == armytank)
- {
- if(GetPlayerScore(playerid) < 3000)
- {
- SendClientMessage(playerid,COLOR_RED,"You can't use this vehicle till 3000 score!");
- ClearAnimations(playerid);
- return 1;
- }
- for(new i = 0; i < PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- count++;
- }
- }
- if(count < 8)
- {
- SendClientMessage(playerid,COLOR_WHITE,"{005E80}GF: {FFFFFF}There is no need to use the Tank now! (There must be atleast 8 people online)");
- ClearAnimations(playerid);
- return 1;
- }
- }
- if(modelid == 425)
- {
- if(dini_Int(AddDirFile(dir_userfiles, playername), "Airforce") == 0)
- {
- SendClientMessage(playerid,COLOR_RED,"You can't use this Hunter!");
- ClearAnimations(playerid);
- return 1;
- }
- for(new i = 0; i < PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- count++;
- }
- }
- if(count < 8)
- {
- SendClientMessage(playerid,COLOR_WHITE,"{005E80}GF: {FFFFFF}There is no need to use the Hunter now! (There must be atleast 8 people online)");
- ClearAnimations(playerid);
- return 1;
- }
- }
- if(ispassenger == 0 || ispassenger == 1)
- {
- for(new i = 0 ; i < MAX_VEHICLES ; i++)
- {
- if(vehicleid == hitman[i])
- {
- if(gTeam[playerid] != Hitman)
- {
- ClearAnimations(playerid);
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_RED, "You are not member of Hitman and you are not allowed use Hitman vehicles!");
- return 1;
- }
- }
- if(vehicleid == alpha[i])
- {
- if(gTeam[playerid] != AlphaSquad)
- {
- ClearAnimations(playerid);
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_RED, "You are not member of Alpha Squad and you are not allowed use Alpha Squad vehicles!");
- return 1;
- }
- }
- if(vehicleid == saf[i])
- {
- if(dini_Int(AddDirFile(dir_userfiles, playername), "Airforce") == 0)
- {
- ClearAnimations(playerid);
- RemovePlayerFromVehicle(playerid);
- SendClientMessage(playerid, COLOR_RED, "You are not member of San Andreas Airforce and you are not allowed use San Andreas Airforce vehicles!");
- return 1;
- }
- }
- }
- }
- if (ispassenger == 0)
- {
- if (vehiclelocked[playerid][vehicleid])
- {
- ClearAnimations(playerid);
- return 1;
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment