how much weed
#1

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
Reply
#2

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

Код:
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.
Reply
#4

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?
Reply
#5

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)