I have a problem
#1

Код:
CMD:pay(player, params[])
{
   new otherid, cash
   new string[128];
   new string2[128];
   if (sscanf(params, "dd", otherid, cash)) SendClientMessage(playerid, 0xFF0000AA, "Използване: /pay [ID] [Cash]");
   else if(GetPlayerMoney(playerid) > cash) SendClientMessage(playerid, 0xFF0000AA, "Ти нямаш толкова пари!");
   else if(IsPlayerConnected(otherid)) SendClientMessage(playerid, 0xFF0000AA, "Играчът го няма в игра");
   else if(otherid == playerid) SendClientMessage(playerid, 0xFF0000AA, "Не можеж да прашташ пари на себе си");
  else
  {
  GivePlayerMoney(playerid, -cash);
  GivePlayerMoney(playerid, -cash);
  GetPlayerMoney(playerid);
  GetPlayerMoney(otherid)
  GetPlayerName(playerid, mame, sizeof(mame));
  GetPlayerName(otherid, name, sizeof(name));
  format(string, sizeof(string), "Tи даде на '%s' около '%s'", playerid,name,cash);
  SendClientMessage(playerid, -1, string);
  format(string, sizeof(string), "Tи получи '%s' от '%s'", otherid,cash,mame);
  SendClientMessage(playerid, -1, string2);
  }
  }
  return 1;
}
Код:
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(659) : warning 215: expression has no effect
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(660) : warning 215: expression has no effect
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(671) : error 001: expected token: ";", but found "new"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(673) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(674) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(674) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(675) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(676) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(676) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(679) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(680) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(681) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(683) : error 001: expected token: ";", but found "-identifier-"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(683) : error 017: undefined symbol "playerid"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(683) : error 017: undefined symbol "mame"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(683) : fatal error 107: too many error messages on one line
Reply
#2

I see you have been making many threads. Please make one fucking thread for all the bugs.
Anyways,
this
pawn Код:
CMD:pay(player, params[])
should be
pawn Код:
CMD:pay(playerid, params[])
Also, remove the
pawn Код:
GetPlayerMoney(playerid);
lines since they have no effect and you are not using them.
Reply
#3

thx i haven't slept but still erors

D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(679) : error 001: expected token: ";", but found "-identifier-"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(679) : error 017: undefined symbol "name"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(679) : error 017: undefined symbol "name"
Reply
#4

Then define name. Create a variable for it.
pawn Код:
new name[MAX_PLAYER_NAME];
Reply
#5

Код:
CMD:pay(playerid, params[])
{
   new otherid, cash;
   new string [128];
   new name[MAX_PLAYERS];
   if (sscanf(params, "dd", otherid, cash)) SendClientMessage(playerid, 0xFF0000AA, "Използване: /pay [ID] [Cash]");
   else if(GetPlayerMoney(playerid) > cash) SendClientMessage(playerid, 0xFF0000AA, "Ти нямаш толкова пари!");
   else if(IsPlayerConnected(otherid)) SendClientMessage(playerid, 0xFF0000AA, "Играчът го няма в игра");
   else if(otherid == playerid) SendClientMessage(playerid, 0xFF0000AA, "Не можеж да прашташ пари на себе си");
  else
  {
  GivePlayerMoney(playerid, -cash);
  GivePlayerMoney(otherid, cash);
  GetPlayerMoney(otherid)
  GetPlayerName(otherid, name, sizeof(name))
  format(string, sizeof(string), "Tи даде на %s около %s", playerid, otherid, cash);
  SendClientMessage(playerid, -1, string);
  }
  return 1;
}
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(677) : error 001: expected token: ";", but found "-identifier-"
D:\igri\GTA-SanAndreas\gamemodes\grandlarc.pwn(67 : error 001: expected token: ";", but found "-identifier-"
Reply
#6

Код:
CMD:pay(playerid, params[])
{
   new otherid, cash,string[128],mame[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
   if (sscanf(params, "ui", otherid, cash)) SendClientMessage(playerid, 0xFF0000AA, "Čзďолзвŕнĺ: /pay [ID] [Cash]");
   else if(GetPlayerMoney(playerid) > cash) SendClientMessage(playerid, 0xFF0000AA, "Ňč н˙ěŕř ňолęовŕ ďŕđč!");
   else if(IsPlayerConnected(otherid)) SendClientMessage(playerid, 0xFF0000AA, "Čăđŕчъň ăо н˙ěŕ в čăđŕ");
   else if(otherid == playerid) SendClientMessage(playerid, 0xFF0000AA, "Нĺ ěоćĺć дŕ ďđŕřňŕř ďŕđč нŕ ńĺбĺ ńč");
   GivePlayerMoney(playerid, -cash);
   GivePlayerMoney(otherid, +cash);
   GetPlayerName(playerid, mame, sizeof(mame));
   GetPlayerName(otherid, name, sizeof(name));
   format(string, sizeof(string), "Tč дŕдĺ нŕ '%s' оęоло '%s'", playerid,name,cash);
   SendClientMessage(playerid, -1, string);
   format(string, sizeof(string), "Tč ďолучč '%s' оň '%s'", otherid,cash,mame);
   SendClientMessage(playerid, -1, string);
   return 1;
}
Reply
#7

ok thx all but can you help with this too


Код:
CMD:checkdrugs(playerid, params[])
{
	new string[100];
	new string2[100];
    format(string, sizeof(string), "Имаш %s Хероин", Heroin[playerid]);
    format(string2, sizeof(string2), "Имаш %s Трева", Weed[playerid]);
    SendClientMessage(playerid, -1, string);
    SendClientMessage(playerid, -1, string2);
    return 1;
}
when i /checkdrug there are no numbers
Reply
#8

will any one help ?
Reply
#9

Quote:
Originally Posted by kaloqn54
Посмотреть сообщение
ok thx all but can you help with this too


Код:
CMD:checkdrugs(playerid, params[])
{
	new string[100];
	new string2[100];
    format(string, sizeof(string), "Имаш %s Хероин", Heroin[playerid]);
    format(string2, sizeof(string2), "Имаш %s Трева", Weed[playerid]);
    SendClientMessage(playerid, -1, string);
    SendClientMessage(playerid, -1, string2);
    return 1;
}
when i /checkdrug there are no numbers
pawn Код:
CMD:checkdrugs(playerid, params[])
{
    new string[100];
    new string2[100];
    format(string, sizeof(string), "Имаш %i Хероин", Heroin[playerid]); // Changed %s to %i.
    format(string2, sizeof(string2), "Имаш %i Трева", Weed[playerid]); // Changed %s to %i.
    SendClientMessage(playerid, -1, string);
    SendClientMessage(playerid, -1, string2);
    return 1;
}
You have to change %s to %i because %s is for a string. With %i, it will return an integer, a number, which is what you want it to return.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)