Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Credits:
- DobbysGamertag: Scritpting the FS.
- Zeex: ZCMD Include
- SA-MP Team, past, present & future.
- You: For trying it out.
- */
- #define FILTERSCRIPT
- #include a_samp
- #include zcmd
- #define COL_RED 0xFF1E00FF
- #define DIALOG_RC 10 //change this if you get conflicts.
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- new InRC[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" RC Car Script DobbysGamertag. ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n--------------------------------------");
- print(" RC Car Script DobbysGamertag. ");
- print("--------------------------------------\n");
- }
- /* COMMAND: */
- COMMAND:rc(playerid,params[])
- {
- if(InRC[playerid] == 1)return SendClientMessage(playerid,COL_RED,"ERROR: You already have an RC Car");
- if(IsPlayerInVehicle(playerid,GetPlayerVehicleID(playerid)))return SendClientMessage(playerid,COL_RED,"ERROR: You cannot use this inside of another car!");
- if(InRC[playerid] == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_RC,DIALOG_STYLE_LIST,"RC Cars","RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam","Go!","Close");
- }
- return 1;
- }
- /* FUNCTIONS */
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if(PRESSED(KEY_SECONDARY_ATTACK))
- {
- if(InRC[playerid] == 1)
- {
- new Float:X,Float:Y,Float:Z;
- new id = GetPlayerVehicleID(playerid);
- GetPlayerPos(playerid,X,Y,Z);
- DestroyVehicle(id);
- RemovePlayerFromVehicle(playerid);
- SetPlayerPos(playerid,X,Y,Z+3);
- InRC[playerid] = 0;
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- InRC[playerid] = 0;
- SendClientMessage(playerid,COL_RED,"This server uses RC Car Script by DobbysGamertag");//don't have to keep this :3 you can remove it.
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_RC)
- {
- if(!response)return 0;
- switch(listitem)
- {
- case 0:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(441,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- case 1:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(464,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- case 2:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(465,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- case 3:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(501,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- case 4:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(564,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- case 5:
- {
- new Float:X,Float:Y,Float:Z,Float:Angle;
- GetPlayerPos(playerid,X,Y,Z);
- new rccar = CreateVehicle(594,X,Y,Z,Angle,-1,-1,60);
- PutPlayerInVehicle(playerid,rccar,0);
- InRC[playerid] = 1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement