[Help]
#1

i have this /ticket command but problem is whenever i type /ticket id price it says : player is offline , so anyone can help??

Код:
new giveplayerid, moneys;
	new giveplayer[MAX_PLAYER_NAME];
	new sendername[MAX_PLAYER_NAME];
	new TicketOffer[MAX_PLAYERS];
	new TicketMoney[MAX_PLAYERS];
	if(strcmp(cmd, "/ticket", true) == 0)
	{

	  if(IsPlayerConnected(playerid))
	  {
	    if(LSPLEADER)
			{
			  SendClientMessage(playerid, red, "  You are not a Cop!");
			  return 1;
			}
	    tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, red, "USAGE: /ticket [playerid/PartOfName] [price]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, red, "USAGE: /ticket [playerid/PartOfName] [price]");
				return 1;
			}
			moneys = strval(tmp);
			if(moneys < 1 || moneys > 301) { SendClientMessage(playerid, red, "  Ticket Money can't be below 1 or higher then 300 !"); return 1; }
			if(IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
			    if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, red, "USAGE: /ticket [playerid/PartOfName] [price]");
							return 1;
						}
						format(string, sizeof(string), "* You gave %s a Ticket costing $%d, reason: %s", giveplayer, moneys, (result));
						SendClientMessage(playerid, blue, string);
						format(string, sizeof(string), "* Officer %s has given you a Ticket costing $%d, reason: %s", sendername, moneys, (result));
						SendClientMessage(giveplayerid, blue, string);
						SendClientMessage(giveplayerid, blue, "* Type /accept ticket, to accept it.");
						TicketOffer[giveplayerid] = playerid;
						TicketMoney[giveplayerid] = moneys;
						return 1;
					}
					else
					{
						SendClientMessage(playerid, red, "  That player is not near you !");
						return 1;
					}
				}
			}
			else
			{
			  SendClientMessage(playerid, red, "  That player is Offline !");
			  return 1;
			}
		}
		return 1;
	}
________
Smartkeys
Reply
#2

EDIT: Sorry, I haven't read the code carefully...
Reply
#3

Just wondering,

What if you replace
Код:
giveplayerid = ReturnUser(tmp);
by
Код:
 giveplayerid = strval(tmp);
?
Reply
#4

bump*
________
Rc116
Reply
#5

anyone?
________
Free wordpress themes
Reply
#6

Quote:
Originally Posted by VonLeeuwen
Just wondering,

What if you replace
Код:
giveplayerid = ReturnUser(tmp);
by
Код:
 giveplayerid = strval(tmp);
?
Try this and give us the answers before bumping
Reply
#7

Quote:
Originally Posted by Niixie
Quote:
Originally Posted by VonLeeuwen
Just wondering,

What if you replace
Код:
giveplayerid = ReturnUser(tmp);
by
Код:
 giveplayerid = strval(tmp);
?
Try this and give us the answers before bumping
i wouldn't bump if it was working
still not working , anyone?
________
Expert insurance
Reply
#8

Bump
________
CHILD WELLBUTRIN
Reply
#9

Bump*
________
Smallville Advice
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)