Phone system - Variables -
Faith - 10.07.2011
Hey lovely scripters.
I've decided to make a phone system, different than all other phone systems.
However, before i can do that, i need to make sure i understand the variables well enough to do it.
I'm here to ask if and of you could explain to me, a very simple system of connecting 2 players with each other.
I'm sorry to ask this, but i've been looking at tutorials, and i couldn't find any that explains a phone system.
I hope one of you will help me on this
Re: Phone system - Variables -
Skylar Paul - 10.07.2011
pawn Код:
new IsonThePhone[MAX_PLAYERS] = -1; //Set this to the ID they're on the phone with.
That's really all I can contribute, it's really easy to connect two players.
Quote:
Originally Posted by Nazi Germany
This forum requires that you wait 120 seconds between posts. Please try again in 39 seconds.
|
Mother F-....
Re: Phone system - Variables -
Faith - 10.07.2011
I'm still a bit confused.
Should the person calling and the person receiving have the variable IsOnThePhone[MAX_PLAYERS] set to -1 ?
What if 4 peoples are connected to IsOnThePhone? :/
Re: Phone system - Variables -
jameskmonger - 10.07.2011
Give up.
Re: Phone system - Variables -
Cameltoe - 10.07.2011
pawn Код:
IsDialing[MAX_PLAYERS]; // When typing Call command.
IsCalling[MAX_PLAYERS]; // When remote Id answers.
command(call, playerid, params[])
{
new string[128], pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, 0x0, "Usage : /call [ Player Name / ID ]");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0x0, "This player is not connected");
if(IsDialing[playerid] != -1) return SendClientMessage(playerid, 0x0, "You are already dialing someone!");
IsDialing[playerid] = pID;
format(string, sizeof(string), "%s is calling you, type /answer to answer", GetName(playerid));
SendClientMessage(pID, 0x0, string);
format(string, sizeof(string), "You are now dialing %s", GetName(pID));
return SendClientMessage(playerid, 0x0, string);
}
Re: Phone system - Variables -
Faith - 10.07.2011
Not a chance, champ.
I'm making a scratchmade script and that is no problems for me.
I just never understood how exactly the variables works in a phone system - which is why i'm here.
Re: Phone system - Variables -
jameskmonger - 10.07.2011
If you don't understand how an array works, I doubt your "scratchmade script" is very good, "champ".
Re: Phone system - Variables -
Cameltoe - 10.07.2011
Quote:
Originally Posted by jameskmonger
If you don't understand how an array works, I doubt your "scratchmade script" is very good, "champ".
|
Everyone has to start somewhere right ? being impolite won't help making his gamemode "good".
Though, i get your point.
Re: Phone system - Variables -
jameskmonger - 10.07.2011
Cameltoe, I just think he should aim lower whilst he is still learning.
Re: Phone system - Variables -
Cameltoe - 10.07.2011
Quote:
Originally Posted by jameskmonger
Cameltoe, I just think he should aim lower whilst he is still learning.
|
Agree.
Look here, some of the sources i used when starting off :
#1
The SA-MP Pawn Bible, this is your #1 resource
#2
The tutorials section
#3
The magical search button