SA-MP Forums Archive
how much weed - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how much weed (/showthread.php?tid=84194)



how much weed - Sal_Kings - 29.06.2009

this is the cmd i use for weed in my server

Код:
hasweed[playerid]++;
Код:
if(!strcmp(cmdtext,"/plantweed",true))
{
if(WeedAlreadyPlanted[playerid]) return SendClientMessage(playerid,0xFF0000AA,"You already planted a plant! Wait first!");
SendClientMessage(playerid,0xFFFFFFFF,"Your weed has been planted, You payed for a seed");
GivePlayerMoney(playerid,-1000);
SetTimerEx("GrowWeed",60000,0,"i",playerid);
WeedAlreadyPlanted[playerid] = true;
return 1;
}

Код:
public GrowWeed(playerid)
  {
  SendClientMessage(playerid,0xffffffaa,"Your plant has grown. Your weed has been harvested.");
  hasweed[playerid]++;
  WeedAlreadyPlanted[playerid] = false;
  return 1;
}
i was wondering if i can make a command like /myweed and it will say how much weed u have


Re: how much weed - Vince - 29.06.2009

pawn Код:
format(string, sizeof(string) "You have %d weed!", hashweed[playerid]);
SendClientMessage(playerid, COLOR_GREEN, string);



Re: how much weed - Sal_Kings - 29.06.2009

Код:
if(!strcmp(cmdtext,"/myweed",true))
	{
  format(string, sizeof(string) "You have %d weed!", hashweed[playerid]);
  SendClientMessage(playerid, COLOR_GREEN, string);
  return 1;
}
Код:
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : error 001: expected token: ",", but found "-string-"
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : error 017: undefined symbol "hashweed"
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\samp02Xserver.win32\_gamemodes_SalsTestingGrounds.pwn(791) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: how much weed - Ignas1337 - 29.06.2009

people, I hate you when you simply ignore what pawn tells you. it tells you that there is a string instead of , and other stuff, but people keep coing to forums and asking for explinations. Can't you understand english, are retards or have too much fuc*ing time?


Re: how much weed - [nl]daplayer - 29.06.2009

Quote:
Originally Posted by Thanatos
people, I hate you when you simply ignore what pawn tells you. it tells you that there is a string instead of , and other stuff, but people keep coing to forums and asking for explinations. Can't you understand english, are retards or have too much fuc*ing time?
Nice saying Thanatos :P

Sal_Kings:

With good looking at the errors and at the command
The first is nog code but use replace (ctrl + h) to replace hashweed to hasweed
The second line is a replace line for the format in the command.
pawn Код:
hashweed[playerid] = hasweed[playerid];
format(string, sizeof(string)/* You forgot the comma (,) here*/, "You have %d weed!", hasweed[playerid);