SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 19/09/2010, 06:56 PM   #1
SmartCop
Big Clucker
 
Join Date: Sep 2010
Posts: 55
Reputation: 0
Default Driving License

Hi guys ! I need some help with a Driving System. Here it's the script:

Code:
#include <a_samp>
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_GRAD1 0xB4B5B7FF
#define MAX_STRING 255
new dmv;
new dmvc;
new CP[MAX_PLAYERS];
new TakingLesson[MAX_PLAYERS];

forward PlayerToPoint();
enum pInfo
{
   pCarLic,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    SetVehicleNumberPlate(dmvc, " School");
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    //new string[128];
	//new name[MAX_PLAYER_NAME];
    if(CP[playerid]==200)//dmv_01
	{
		if(IsPlayerInVehicle(playerid, 277))
		{
	    	DisablePlayerCheckpoint(playerid);
			CP[playerid] = 201;
			SetPlayerCheckpoint(playerid, 1432.4354,-1658.6343,13.1245, 5.0);
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Test: You aren't into the car !");
		    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Test: You have failed exam !");
		    DisablePlayerCheckpoint(playerid);
    		RemovePlayerFromVehicle(playerid);
  			SetVehicleToRespawn(277);
  			SetVehicleNumberPlate(dmvc, " School");
  			TakingLesson[playerid] = 0;
		}
	}
	else if(CP[playerid]==201)//dmv_02
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 202;
		SetPlayerCheckpoint(playerid, 1432.3827,-1588.9227,13.1318, 5.0);
	}
	else if(CP[playerid]==202)//dmv_03
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 203;
		SetPlayerCheckpoint(playerid, 1454.7500,-1480.2014,13.0978, 5.0);
	}
	else if(CP[playerid]==203)//dmv_04
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 204;
		SetPlayerCheckpoint(playerid, 1457.2000,-1439.2382,13.1303, 5.0);
	}
	else if(CP[playerid]==204)//dmv_05
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 205;
		SetPlayerCheckpoint(playerid, 1429.9436,-1437.6150,13.1244, 5.0);
	}
   	else if(CP[playerid]==205)//dmv_06
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 206;
		SetPlayerCheckpoint(playerid, 1423.7155,-1398.9248,13.1238, 5.0);
	}
	else if(CP[playerid]==206)//dmv_07
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 207;
		SetPlayerCheckpoint(playerid, 1350.0922,-1393.0492,13.1469, 5.0);
	}
	else if(CP[playerid]==207)//dmv_08
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 208;
		SetPlayerCheckpoint(playerid, 1106.5748,-1397.0431,13.1716, 5.0);
	}
	else if(CP[playerid]==208)//dmv_09
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 209;
		SetPlayerCheckpoint(playerid, 1059.6833,-1419.8898,13.1155, 5.0);
	}
	else if(CP[playerid]==209)//dmv_10
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 210;
		SetPlayerCheckpoint(playerid, 1035.0563,-1571.5737,13.1341, 5.0);
	}
	else if(CP[playerid]==210)//dmv_11
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 211;
		SetPlayerCheckpoint(playerid, 1143.5441,-1574.9717,13.0121, 5.0);
	}
	else if(CP[playerid]==211)//dmv_12
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 212;
		SetPlayerCheckpoint(playerid, 1289.9336,-1574.8125,13.1246, 5.0);
	}
	else if(CP[playerid]==212)//dmv_13
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 213;
		SetPlayerCheckpoint(playerid, 1295.0909,-1659.1091,13.1246, 5.0);
	}
	else if(CP[playerid]==213)//dmv_14
	{
		DisablePlayerCheckpoint(playerid);
		CP[playerid] = 214;
		SetPlayerCheckpoint(playerid, 1295.0031,-1704.4797,13.1240, 5.0);
	}
	else if(CP[playerid]==214)//dmv_15
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 215;
		SetPlayerCheckpoint(playerid, 1299.5117,-1817.1479,13.1245, 5.0);
	}
	else if(CP[playerid]==215)//dmv_16
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 216;
		SetPlayerCheckpoint(playerid, 1300.8134,-1855.0059,13.1245, 5.0);
	}
	else if(CP[playerid]==216)//dmv_17
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 217;
		SetPlayerCheckpoint(playerid, 1389.0083,-1874.1768,13.1245, 5.0);
	}
	else if(CP[playerid]==217)//dmv_18
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 218;
		SetPlayerCheckpoint(playerid, 1523.0303,-1874.8875,13.1266, 5.0);
	}
	else if(CP[playerid]==218)//dmv_19
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 219;
		SetPlayerCheckpoint(playerid, 1571.1161,-1872.5188,13.1252, 5.0);
	}
	else if(CP[playerid]==219)//dmv_20
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 220;
		SetPlayerCheckpoint(playerid, 1572.3271,-1733.9789,13.1269, 5.0);
	}
	else if(CP[playerid]==220)//dmv_21
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 221;
		SetPlayerCheckpoint(playerid, 1531.4258,-1730.1346,13.1245, 5.0);
	}
	else if(CP[playerid]==221)//dmv_22
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 222;
		SetPlayerCheckpoint(playerid, 1437.5671,-1730.2736,13.1254, 5.0);
	}
	else if(CP[playerid]==222)//dmv_23
	{
	    DisablePlayerCheckpoint(playerid);
		CP[playerid] = 223;
		SetPlayerCheckpoint(playerid, 1424.2367,-1694.3533,13.2030, 5.0);
	}
	else if(CP[playerid]==223)//dmv_Final
	{
		new pName[24];
		new str[128];
		GetPlayerName(playerid, pName, 24);
		GivePlayerMoney(playerid, -5000);
 		format(str, 128,"dmven: Felicitari %s! Ai luat licenta de condus.", pName);
 		SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
 		RemovePlayerFromVehicle(playerid);
  		SetVehicleToRespawn(277);
  		SetVehicleNumberPlate(dmvc, " School");
  		TakingLesson[playerid] = 0;
		PlayerInfo[playerid][pCarLic] = 1;
		DisablePlayerCheckpoint(playerid);
	}
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
   if(pickupid == dmv)
   {
      GameTextForPlayer(playerid,"~g~Welcome to our Drive School ! ~n~~y~Write /drive for driving license ! ~n~~w~Cost: 500$ !", 500, 3);
   }
}

public OnFilterScriptInit()
{
   dmv = CreatePickup(1239, 23, 1412.8313,-1700.3066,13.5395); //dmv_DMV
   dmvc = AddStaticVehicleEx(506,1413.2147,-1717.5602,13.2899,359.6807,12,12,10); //dmv Car
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
   	if(strcmp(cmdtext, "/drive", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		    if(PlayerInfo[playerid][pCarLic] == 0)
		    {
		    	if(IsPlayerInRangeOfPoint(playerid, 3.0, 1412.8313, -1700.3066, 13.5395))
		    	{
   					CP[playerid] = 200;
   					SetPlayerCheckpoint(playerid, 1421.1475,-1699.3237,13.2888, 4.0);
	    			TakingLesson[playerid] = 1;
    				PutPlayerInVehicle(playerid, 277, 0);
    				SendClientMessage(playerid, COLOR_LIGHTBLUE, "Test: Please follow the checkpoints and drive safety !");
   				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "Drive License: You already have a Drive License !");
			    return 1;
			}
		}
		return 1;
	}
    return 0;
}
What i want to add ->

- A Tutorial when you enter the checkpoint.
- After checkpoint to ask you four questions (at questions: if you don't give the correct answer to failed the examen -- with message if the answer it's bad, or good).
- After the questions to teleport you into a car and to give the examen .

If you can do this:

- If a player get into the car and he don't have drive license, to warn him with this message: 'You don't have Driving License. Write /dtel to teleport you at the place where you can take your exam !', but the player to can drive.
- If the player write /dtel to teleport him at this coords: ' 1432.4354,-1658.6343,13.1245, 5.0' .

I need help guys ! Thankyou again, thankyou so much !
SmartCop is offline  
Old 19/09/2010, 07:21 PM   #2
Steven82
High-roller
 
Join Date: Nov 2009
Posts: 2,431
Reputation: 186
Default Re: Driving License

Well i not going to help but i will tell you one thing,


SetVehicleNumberPlate was disabled in 0.3a/0.3b
__________________
If you read my old posts; I apologize in advance.
Steven82 is offline  
Old 20/09/2010, 05:33 AM   #3
SmartCop
Big Clucker
 
Join Date: Sep 2010
Posts: 55
Reputation: 0
Default Re: Driving License

But yesterday i saw a server 0.3b with this idea.
SmartCop is offline  
Old 20/09/2010, 05:46 AM   #4
Retardedwolf
High-roller
 
Retardedwolf's Avatar
 
Join Date: Jun 2009
Posts: 1,466
Reputation: 60
Default Re: Driving License

3DTextLabel.
Retardedwolf is offline  
Old 20/09/2010, 04:00 PM   #5
SmartCop
Big Clucker
 
Join Date: Sep 2010
Posts: 55
Reputation: 0
Default Re: Driving License

I can't do ... Somebody to help me, please ?
SmartCop is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [FS]Driving License nate660 Filterscripts 54 21/09/2013 09:34 AM
add mod to current car driving? campkz Help Archive 5 05/04/2010 10:46 PM


All times are GMT. The time now is 04:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.