SA-MP Forums Archive
[FilterScript] Animals [First FS] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Animals [First FS] (/showthread.php?tid=522657)

Pages: 1 2


[FIXED] Animals [First FS] - MrWupiazZzLT - 28.06.2014

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


Video

http://www.youtube.com/watch?v=YcZkl...ature=*********

Pastebin.COM
http://pastebin.com/kPy2MK4g


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;
 }



Re: Animals [First FS] - pEmanZ - 28.06.2014

Not bad, Nice work


Re: Animals [First FS] - NewerthRoleplay - 28.06.2014

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!


Re: Animals [First FS] - MrWupiazZzLT - 28.06.2014

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..


Re: Animals [First FS] - Team_PRO - 28.06.2014

post the codes?


Re: Animals [First FS] - pEmanZ - 28.06.2014

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


Re: Animals [First FS] - MrWupiazZzLT - 28.06.2014

Okay guys i forgot the scripts try now


Re: Animals [First FS] - Rocky1993 - 28.06.2014

Not Bad.


Re : Animals [First FS] - Clad - 28.06.2014

Not bad.


Re: Animals [First FS] - MrWupiazZzLT - 28.06.2014

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


Re: Animals [First FS] - MrWupiazZzLT - 28.06.2014

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...


Re: Animals [First FS] - iZN - 28.06.2014

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


Re : Re: Animals [First FS] - Clad - 28.06.2014

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.
}



Re: Animals [First FS] - MrWupiazZzLT - 28.06.2014

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


Re: Animals [First FS] - AiRaLoKa - 28.06.2014

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


Re: Animals [First FS] - MrWupiazZzLT - 29.06.2014

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


Re: Animals [First FS] - MrWupiazZzLT - 05.07.2014

Up! Rate comment and what i should script next?


Re: Animals [First FS] - Abagail - 05.07.2014

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?


Re: Animals [First FS] - MrWupiazZzLT - 06.07.2014

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


Re: Animals [First FS] - MrWupiazZzLT - 06.07.2014

Updated, added Pastebin.com and Code