SA-MP Forums Archive
Help me please..... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me please..... (/showthread.php?tid=145667)



Help me please..... - David-Sean - 03.05.2010

My cell phone commands problem.
Why no have animations my cell phone here is my code Pickup
Код:
	if(strcmp(cmd, "/pickup", true) == 0 || strcmp(cmd, "/p", true) == 0)
	{
    if(IsPlayerConnected(playerid))
		{
			if(Mobile[playerid] != 255)
			{
				SendClientMessage(playerid, COLOR_GRAD2, " You are already on a call...");
				return 1;
			}
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
					if(Mobile[i] == playerid)
					{
						Mobile[playerid] = i; //caller connecting
						SendClientMessage(i, COLOR_GRAD2, "  They Picked up the call.");
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "* %s answers his cellphone.", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						RingTone[playerid] = 0;
					}

				}
			}
		}
		return 1;
	}



Here is Hangup
Код:
	if(strcmp(cmd, "/hangup", true) == 0 || strcmp(cmd, "/h", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			new caller = Mobile[playerid];
			if(IsPlayerConnected(caller))
			{
			  if(caller != INVALID_PLAYER_ID)
			  {
					if(caller != 255)
					{
						if(caller < 255)
						{
							SendClientMessage(caller, COLOR_GRAD2, "  They hung up.");
							CellTime[caller] = 0;
							CellTime[playerid] = 0;
							SendClientMessage(playerid, COLOR_GRAD2, "  You hung up.");
							Mobile[caller] = 255;
						}
						Mobile[playerid] = 255;
						CellTime[playerid] = 0;
						RingTone[playerid] = 0;
						return 1;
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, "  Your phone is in your pocket.");
		}
		return 1;
	}
Here is cell
Code
Код:
	if(strcmp(cmd, "/call", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /call [phonenumber]");
				return 1;
			}
			if(PlayerInfo[playerid][pPnumber] == 0)
			{
				SendClientMessage(playerid, COLOR_GRAD2, " You dont'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);
			if(phonenumb == 911)
			{
				SendClientMessage(playerid, COLOR_WHITE, "HINT: You now use T to talk on your cellphone, type /hangup to hang up");
				SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Which Service Do You Require, Police or Fireman?");
				Mobile[playerid] = 911;
				return 1;
			}
			if(phonenumb == PlayerInfo[playerid][pPnumber])
			{
				SendClientMessage(playerid, COLOR_GRAD2, " You just get a busy tone...");
				return 1;
			}
			if(Mobile[playerid] != 255)
			{
				SendClientMessage(playerid, COLOR_GRAD2, " You are already on a call...");
				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;
						    }
								if (Mobile[giveplayerid] == 255)
								{
									format(string, sizeof(string), "Your Mobile is Ringing Type (/Pickup) CallerID: %s", sendername);
									SendClientMessage(giveplayerid, COLOR_YELLOW, string);
									GetPlayerName(giveplayerid, sendername, sizeof(sendername));
									RingTone[giveplayerid] = 10;
									format(string, sizeof(string), "* %s's phone begins to ring.", sendername);
									SendClientMessage(playerid, COLOR_WHITE, "HINT: You now use T to talk on your cellphone, type /hangup to hang up");
									ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
									CellTime[playerid] = 1;
									return 1;
								}
							}
						}
					}
				}
			}
			SendClientMessage(playerid, COLOR_GRAD2, " You just get a Busy tone...");
		}
		return 1;



Re: Help me please..... - 0ne - 03.05.2010

use special actions ?



Re: Help me please..... - David-Sean - 03.05.2010

lest me give screenshots.


Re: Help me please..... - David-Sean - 03.05.2010



HELP PLEASE!!


Re: Help me please..... - 0ne - 03.05.2010

https://sampwiki.blast.hk/wiki/SpecialActions

https://sampwiki.blast.hk/wiki/SetPlayerSpecialAction


Re: Help me please..... - David-Sean - 03.05.2010

Thanks bro