How to make...
#1

How do i create a command that can be....like NVM...i give you an EX.


a /plantweed command?

How do i make it so it plants where the player stands and not just one spot?
Reply
#2

GetPlayerPos(playerid, x, y, z);

use the x y and z to place then.
Reply
#3

Post your cmd ere will make it easier to sort it for you
Reply
#4

Quote:
Originally Posted by adsy
GetPlayerPos(playerid, x, y, z);

use the x y and z to place then.
But like lets say i want to plant weed way over there and i do /plantweed


then i go somewhere else and do /plantweed....


I want the weed to plant where ever they do

/plantweed


EDIT:

I do not post my commands or coding anymore i have already had 1 RP script stole from me...:@
so i was just asking is that the right coding?
Reply
#5

im not writing it all for you. get an example script together and we can "edit" it in.
Reply
#6

I know it will be a simple script were you do like /plantweed and aw...wth i will make it right now and post it xD not a big command xD


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/plantweed", cmdtext, true, 10) == 0)
	{
	//CreateObject want to also add when you plant weed the Bush ID i already have it but need Cordinates
	SendClientMessage(playerid, COLOR_GREEN, " You weed has been planted come back later");
	GivePlayerMoney(playerid, -10);
		return 1;
	}
	if (strcmp("/pickweed", cmdtect, true, 10) == 0)
	{
	// I want to destroy ojbect when picked
	SendClientMessage(playerid, COLOR_GREEN, " You have just picked your weed now type: (/weedhelp) to learn how to sell it.");

	return 0;
}
Reply
#7

do you want lots of weeds from 1 player or 1 weed per player
Reply
#8

1 weed per player and like they have to wait like 30 minutes until they can /pickweed
Reply
#9

something like my onespot filterscript then

http://forum.sa-mp.com/index.php?topic=157116.0

change st to plantweed and mt to pickweed

youll want to start a timer under plantweed then

Код:
SetTimer("plantwait", (60000*30), 0);
plant[playerid]=1;
and a new somewhere outside

Код:
new plant[MAX_PLAYERS];
the function should simply change the variable plant back to 0

Код:
forward plantwait(playerid)
public plantwait(playerid){
plant[playerid]=0;
return 1;
}
then under your modified /mt command just add an if

Код:
if(plant[playerid] == 1){
MESSAGE HERE
}
else{
if player is near the plant allow picking
else message to say you arent near your plant
}
think you can work from that?

EDIT: you will probably need an anti replant to prevent multiple timers and multiple plants per player, only the last one planted coords will work though.
Reply
#10

Everytime i try to compile error, error, whatever i will try to make it and fail drasticly until i get it but thanks anyway guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)