Jump to content
  • 0

Un Mic Ajutor Va Rog


EmiNEm

Question

Salut, cum as putea sa fac sa apara "sms"urile si :w" trimise de playeri cand e activat bigears?

Comanda mea de SMS:

if(strcmp(cmd, "/txt", true) == 0 || strcmp(cmd, "/t", true) == 0 || strcmp(cmd, "/sms", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/t)ext [phonenumber] [text chat]");
				return 1;
			}
			if(PlayerInfo[playerid][pPnumber] == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  You don't have a cell phone...");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			new phonenumb = strval(tmp);
			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, COLOR_GRAD2, "USAGE: (/t)ext [phonenumber] [text chat]");
				return 1;
			}
			if(phonenumb == 555)
			{
				if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
				{
					SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered.");
					if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
					{
						SendClientMessage(playerid, COLOR_YELLOW, "SMS: I have no idea what you're talking about, Sender: MOLE (555)");
						RingTone[playerid] = 20;
						return 1;
					}
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_YELLOW, "SMS: A simple Yes will do, Sender: MOLE (555)");
					RingTone[playerid] = 20;
					return 1;
				}
			}
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
					{
						giveplayerid = i;
						Mobile[playerid] = giveplayerid; //caller connecting
						if(IsPlayerConnected(giveplayerid))
						{
						    if(giveplayerid != INVALID_PLAYER_ID)
						    {
						        if(PhoneOnline[giveplayerid] > 0)
						        {
						            SendClientMessage(playerid, COLOR_GREY, "   That players Phone is Offline!");
						            return 1;
						        }
								format(string, sizeof(string), "SMS: %s, Sender: %s ({FFFFFF}%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
								GetPlayerName(giveplayerid, sendername, sizeof(sendername));
								//format(string, sizeof(string), "* %s's phone beeps.", sendername);
								RingTone[giveplayerid] =20;
								SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered");
								SendClientMessage(giveplayerid, COLOR_YELLOW, string);
								SendClientMessage(playerid,  COLOR_YELLOW, string);
								format(string, sizeof(string), "~r~$-%d", txtcost);
								GameTextForPlayer(playerid, string, 5000, 1);
								GivePlayerCash(playerid,-txtcost);
								SBizzInfo[2][sbTill] += txtcost;
								ExtortionSBiz(2, txtcost);
					           	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
					           	Mobile[playerid] = 255;
								return 1;
							}
						}
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "  Message Delivery Failed...");
		}
		return 1;
	}
Comanda de /w
if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)hisper [playerid/PartOfName] [whisper text]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        new Float:x, Float:y, Float:z;
           			GetPlayerPos(giveplayerid,x,y,z);
			        if(PlayerToPoint(5, playerid, x, y, z))
			        {
						GetPlayerName(playerid, sendername, sizeof(sendername));
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						if(giveplayerid == playerid)
						{
							format(string, sizeof(string), "* %s mutters something to himself.", sendername);
							ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						}
						else
						{
						    format(string, sizeof(string), "* %s whispers something to %s", sendername, giveplayer);
							ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						}
						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, COLOR_GRAD2, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]");
							return 1;
						}
						format(string, sizeof(string), "%s whispers: %s", sendername, (result));
						SendClientMessage(giveplayerid, COLOR_YELLOW, string);
						format(string, sizeof(string), "%s whispers: %s", sendername, (result));
						SendClientMessage(playerid,  COLOR_YELLOW, string);
						return 1;
					}
					else
					{
					    SendClientMessage(playerid,  COLOR_GREY, "    Player is not near you !");
					    return 1;
					}
				}
			}
			else
			{
					format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}

index.php?Name=Indecen3T
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.