/giveweed
#5

pawn Код:
if(!strcmp(cmdtext,"/giveweed",true, 9))
{
  new givename[MAX_PLAYER_NAME];
  if(!strlen(cmdtext[9])) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /giveweed [playerid]");
  if(hasweed[playerid] <= 0) return SendClientMessage(playerid,0xFF0000AA,"You don't have any weed to give out!");
  new giveid = strval(cmdtext[10]);
  if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, 0xFF0000AA, "That player isnt connected");
  new string2[128];
  new adminname[MAX_PLAYER_NAME];
  GetPlayerName(giveid, givename, sizeof(givename));
  GetPlayerName(playerid, adminname, sizeof(adminname));
  format(string,sizeof(string),">> You have given %s 1 unit of weed", givename);
  SendClientMessage(playerid,0xFF8000FF, string);
  format(string2,sizeof(string2),">> You have received 1 unit of weed from %s ", adminname);
  SendClientMessage(giveid,0xFF8000FF, string2);
  GivePlayerMoney(giveid,-1000);
  GivePlayerMoney(playerid, 1000);
  hasweed[giveid]++;
  hasweed[playerid]--;
  return 1;
}
I added
pawn Код:
new givename[MAX_PLAYER_NAME];
and if you guys looked at the other errors, it said that he didn't need
pawn Код:
new string[128];
so i deleted that.
Reply


Messages In This Thread
/giveweed - by Sal_Kings - 17.05.2009, 13:10
Re: /giveweed - by Rks25 - 17.05.2009, 13:12
Re: /giveweed - by Sal_Kings - 17.05.2009, 13:13
Re: /giveweed - by Correlli - 17.05.2009, 13:14
Re: /giveweed - by Badger(new) - 17.05.2009, 13:15
Re: /giveweed - by Sal_Kings - 17.05.2009, 13:18
Re: /giveweed - by Badger(new) - 17.05.2009, 13:28
Re: /giveweed - by Sal_Kings - 17.05.2009, 13:31
Re: /giveweed - by Rks25 - 17.05.2009, 13:32
Re: /giveweed - by Sal_Kings - 17.05.2009, 13:34

Forum Jump:


Users browsing this thread: 1 Guest(s)