[FilterScript] Animals [First FS]
#1

Animal Cars
This filterscript let you make animal cars! This filterscript will be updating and adding some more animals!


Commands
See ALL commands ingame or video typed: /animals


Bugs know
None! [Thanks for AiRaLoKa!]


Credits
Pawno, SA-MP, GtaSA, AiRaLoKa




Code

Код:
#define FILTERSCRIPT
#include <a_samp>

new objectid[3];
new vehicleid[3];

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/animals", cmdtext, true, 10) == 0)
	{
		ShowPlayerDialog(playerid, 98123, DIALOG_STYLE_MSGBOX, "Animals", "{FFFFFF}/deer {66FF00}- Spawns Deer \n{FFFFFF}/turtle {66FF00}- Spawns Turtle \n{FFFFFF}/cow {66FF00}- Spawns Cow", "Okay", "");
	}
	if (strcmp("/deer", cmdtext, true, 10) == 0)
	{
		new int1 = GetPlayerInterior(playerid);
	 	new Float: x, Float: y, Float: z, Float: r, deer;
	 	GetPlayerPos(playerid,x,y,z);
	 	GetPlayerFacingAngle(playerid,r);
	 	deer = CreateVehicle(522,x,y,z,r,000,000,0);
	 	PutPlayerInVehicle(playerid,deer,0);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),int1+1);
		objectid[0] = CreateObject(19315,0,0,0,0,0,0);
		vehicleid[0] = GetPlayerVehicleID(playerid);
		AttachObjectToVehicle(objectid[0], vehicleid[0], 0.0, 0.0, 0.0, 0.0, 0.0, 90.0);
		SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Deer {FFFFFF}spawned!");
		return 1;
	}
	if (strcmp("/turtle", cmdtext, true, 10) == 0)
	{
		new int2 = GetPlayerInterior(playerid);
	 	new Float: x, Float: y, Float: z, Float: r, turtle;
	 	GetPlayerPos(playerid,x,y,z);
	 	GetPlayerFacingAngle(playerid,r);
	 	turtle = CreateVehicle(571,x,y,z,r,000,000,0);
	 	PutPlayerInVehicle(playerid,turtle,0);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),int2+1);
		objectid[1] = CreateObject(1609,0,0,0,0,0,0);
		vehicleid[1] = GetPlayerVehicleID(playerid);
		AttachObjectToVehicle(objectid[1], vehicleid[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
		SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Turtle {FFFFFF}spawned!");
		return 1;
	}
	if (strcmp("/cow", cmdtext, true, 10) == 0)
	{
		new int3 = GetPlayerInterior(playerid);
	 	new Float: x, Float: y, Float: z, Float: r, cow;
	 	GetPlayerPos(playerid,x,y,z);
	 	GetPlayerFacingAngle(playerid,r);
	 	cow = CreateVehicle(573,x,y,z,r,000,000,0);
	 	PutPlayerInVehicle(playerid,cow,0);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),int3+1);
		objectid[2] = CreateObject(16442,0,0,0,0,0,0);
		vehicleid[2] = GetPlayerVehicleID(playerid);
		AttachObjectToVehicle(objectid[2], vehicleid[2], 0.0, 0.0, 0.5, 0.0, 0.0, 90.0);
		SendClientMessage(playerid,0xFFFFFFFF, "{FFFFFF}Animals: {66FF00}Cow {FFFFFF}spawned!");
		return 1;
	}
 	return 1;
 }
Reply
#2

Not bad, Nice work
Reply
#3

So you didn't post the code, and the only bug is that it doesn't work?

EDIT: ^Damn spammer.. Didn't even read the post!
Reply
#4

Quote:
Originally Posted by NewerthRoleplay
Посмотреть сообщение
So you didn't post the code, and the only bug is that it doesn't work?
Oh fail... Wait a mintute..
Reply
#5

post the codes?
Reply
#6

Quote:
Originally Posted by NewerthRoleplay
Посмотреть сообщение
So you didn't post the code, and the only bug is that it doesn't work?

EDIT: ^Damn spammer.. Didn't even read the post!
I did watch the video
Reply
#7

Okay guys i forgot the scripts try now
Reply
#8

Not Bad.
Reply
#9

Not bad.
Reply
#10

Quote:
Originally Posted by Rocky1993
Посмотреть сообщение
Not Bad.
Quote:
Originally Posted by Clad
Посмотреть сообщение
Not bad.
Thanks
Reply
#11

Quote:
Originally Posted by NewerthRoleplay
Посмотреть сообщение
So you didn't post the code, and the only bug is that it doesn't work?

EDIT: ^Damn spammer.. Didn't even read the post!
EDIT: Oh.. Its do the functions everything working but the chat saying that...
Reply
#12

OnPlayerCommandText should return false/0 not true/1. (Refer to the wiki page)
Reply
#13

Quote:
[If you know how to fix please tell me I will add in credits]
pawn Код:
return 1;
        // Returning 1 informs the server that the command has been processed.
        // OnPlayerCommandText won't be called in other scripts.
    }
    return 0;
    // Returning 0 informs the server that the command hasn't been processed by this script.
    // OnPlayerCommandText will be called in other scripts until one returns 1.
    // If no scripts return 1, the 'SERVER: Unknown Command' message will be shown to the player.
}
Reply
#14

Quote:
Originally Posted by iZN
Посмотреть сообщение
OnPlayerCommandText should return false/0 not true/1. (Refer to the wiki page)
I did it, but only one command don't say that.. [/animals] Every other commands saying Server: Unknown Command
Reply
#15

oh LOL XD
it's funny...
but you got a lot of error there.
here some fix from me.
Reply
#16

Quote:
Originally Posted by AiRaLoKa
Посмотреть сообщение
oh LOL XD
it's funny...
but you got a lot of error there.
here some fix from me.
Thanks! As I said i will add you to credits! Thanks again! +1
Reply
#17

Up! Rate comment and what i should script next?
Reply
#18

Well it would've been better if you actually created a real system here. But all you did was attach an object, and set an NRG's virtual world to something other than the players. Not really impressive. Also, can you please provide a pastebin link?
Reply
#19

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Well it would've been better if you actually created a real system here. But all you did was attach an object, and set an NRG's virtual world to something other than the players. Not really impressive. Also, can you please provide a pastebin link?
Okay, but its my first filterscript so im not very good scripter
Reply
#20

Updated, added Pastebin.com and Code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)