"That player isn't connected" error
#1

Hai guys, everytime I try and use this, even when it's with a player that is online, it says "that player isn't online" how can I fix it so it works?

Код:
		if(SellingDrugs[playerid] == 1)
		{
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
				if(giveplayerid != INVALID_PLAYER_ID)
				{
					if(giveplayerid == playerid)
					{
						SendClientMessage(playerid, COLOR_GREY, "Cant sell to yourself!");
						return 0;
					}
					if(ProxDetectorS(8.0, playerid, giveplayerid))
					{
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "* You offerd %s to buy %d gram of drugs for $%d .", giveplayer, SellingGrams[playerid], GramPrice[playerid]);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "* Drug Dealer %s wants to sell you %d grams of Crack for $%d, (type /accept drugs) to buy.", sendername, SellingGrams[playerid], GramPrice[playerid]);
						SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						CrackOffer[giveplayerid] = playerid;
						CrackPrice[giveplayerid] = GramPrice[playerid];
						CrackGram[giveplayerid] = SellingGrams[playerid];
						SellingDrugs[playerid] = 255;
						return 0;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "  That player is not near you !");
						SellingDrugs[playerid] = 255;
						return 0;
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "  That player is offline.");
				SellingDrugs[playerid] = 255;
				return 0;
			}
		}
Does anyone know what could be wrong? Please help me out.
Reply
#2

Код:
		if(listitem == 0)
		{
 			SendClientMessage(playerid, COLOR_LIGHTBLUE, "** Please type in the player ID you'd like to sell to.");
			SellingDrugs[playerid] = 1;
			SellingGrams[playerid] = 2;
			GramPrice[playerid] = 200;
		}
Reply
#3

No command code man, just that it's all through dialogs, and I have those done and working, only thing is that stupid "That player isn't online" thing. Should work idk why it isn't, because I check this too:

Код:
		}
		if(Mobile[playerid] == 411)
		{
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
				if(giveplayerid != INVALID_PLAYER_ID)
 				{
					if (PlayerInfo[giveplayerid][pPHListing] == 1)
					{
						SendClientMessage(playerid, COLOR_WHITE, "DIRECTORY ENQUIRIES: This number is not listed, please try again later.");
						SendClientMessage(playerid, COLOR_GRAD2, "  They Hung Up...");
						Mobile[playerid] = 255;
						return 0;
					}
					GetPlayerName(giveplayerid, sendername, sizeof(sendername));
					format(string, 256, "DIRECTORY ENQUIRIES: The phone number for %s is %d, have a nice day.",sendername,PlayerInfo[giveplayerid][pPnumber]);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					SendClientMessage(playerid, COLOR_GRAD2, "  They Hung Up...");
					GivePlayerMoney(playerid,-250);
					format(string, sizeof(string), "~r~-$250");
					GameTextForPlayer(playerid, string, 5000, 1);
					Mobile[playerid] = 255;
					return 0;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_WHITE, "DIRECTORY ENQUIRIES: Sorry, I can't find that person in our database");
				SendClientMessage(playerid, COLOR_GRAD2, "  They Hung Up...");
				Mobile[playerid] = 255;
				return 0;
			}
		}
Which is under the same thing as the SellingDrugs[playerid], the code above works perfect, don't know why this one is being gay, maybe someone can figure it out.
Reply
#4

So how does that work, because if you see how I have it, it basically makes it so you're on the phone kinda. Can you please post the code on how I would do it, and make inputtext defined.
Reply
#5

So Basically I have it to where you press T and type in the player ID.
Reply
#6

do not bump!!!!!!!! you know the forums rules only every 12 hours. And why LSZ or what ever. And btw guys this is keboo13.
Reply
#7

Okay, got another question for you. How can I make it open another dialog saying "Please type in the ID of the person you would like to sell to", then type it in?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)