SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 10/08/2009, 04:02 PM   #1
gemadon
Big Clucker
 
Join Date: Oct 2008
Posts: 120
Reputation: 0
Default Whats wrong with my cell phone script?

Code:
dcmd_call(playerid, params[])
{
	if(Phone[playerid] != 1)
	{
	SCM(playerid, COLOR_RED, "You do not have a cell phone!");
	return 1;
	}
	if (player[playerid][calling] || player[playerid][caller] != 255)
 	{
 		SendClientMessage(playerid, 0xBFC0C2FF, "You are already on the phone. use /hangup to hangup");
  	return 1;
  }

 	if (!strlen(params))
  	{
  	SendClientMessage(playerid, 0xBFC0C2FF, "USAGE: /call <phonenumber>");
   	return 1;
  }
  new name[16];
  GetPlayerName(playerid, name, 16);
  new string[41];
  format(string, sizeof(string), "* %s takes out a cellphone.", name);
  ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  new phonenumb = strval(params);
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
  	if(IsPlayerConnected(i))
   	{
   		if(Number[i] == phonenumb && phonenumb != 0 && player[i][calling] && player[i][caller] == 255 && i != playerid)
    	{
     		format(string, sizeof(string), "Caller ID: %s", name);
      		SendClientMessage(i, 0xFFFF00AA, string);
       	SendClientMessage(i, 0xFFFFFFFF, "Tip: Use /pickup to answer your phone");
       	GetPlayerName(i, name, sizeof(name));
        	format(string, sizeof(string), "You are calling %s...", name);
        SendClientMessage(playerid, 0xFFFFFFAA, string);
        SendClientMessage(i, 0xFFFFFFFF, "TIP: to hangup, type /hangup");
        startphone(playerid);
        player[playerid][calling] = false;
        player[playerid][caller] = i;
        player[i][calling] = false;
        player[i][caller] = playerid;
        return 1;
       }
     }
   }
  return 1;
}

I have a cell phone system scripted into my server and it gives them numbers and all that, but for some reason, my /call command wont connect to any other player, can someone take a look at it and tell me whats wrong?
gemadon is offline  
Old 11/08/2009, 02:50 PM   #2
gemadon
Big Clucker
 
Join Date: Oct 2008
Posts: 120
Reputation: 0
Default Re: Whats wrong with my cell phone script?

*BUMP* Can someone HELP ME OUT??
gemadon is offline  
Old 11/08/2009, 02:57 PM   #3
James_Alex
Gangsta
 
Join Date: Dec 2008
Posts: 571
Reputation: 0
Default Re: Whats wrong with my cell phone script?

check this
"phonenumb" i got the same probleme as you when i was creating my phone fs
juste try
pawn Code:
new str[128]; format(str, 128, "You tyed %d", phonenumb);
SendClientMessage(playerid, COLOR_YELLOW, str);
and if the message dosen't got the same number as you typed, try to fix the "new phonenumber" ...
James_Alex is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [FS] Cell Phone Script -- V5.0 Out Now! [nl]daplayer Filterscripts 72 09/09/2012 09:27 AM
what cell phone do you have? whooper Everything and Nothing 475 31/08/2012 08:01 PM
Whats your dream phone? Toni Everything and Nothing 26 05/07/2010 06:18 PM
Phone script... Need help. introzen Help Archive 5 01/11/2009 03:18 PM
Need help scripting cell phone system? gemadon Server Support 2 30/07/2009 06:56 PM


All times are GMT. The time now is 03:00 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.