28.05.2012, 13:24
And hello again.. I don't really know what is made of me without you guys.
I made my first phone system, but it says me all the time "You get a busy tone.". It's the text i setted to return when the number the player called is not an existent number.
To see if it exists, i used foreach to check all players phone number, and if some of them is the call number, it will call him.. The code explains better. Actualy tested with a friend, and both me and him couldn't call each other.
Thanks
I made my first phone system, but it says me all the time "You get a busy tone.". It's the text i setted to return when the number the player called is not an existent number.
To see if it exists, i used foreach to check all players phone number, and if some of them is the call number, it will call him.. The code explains better. Actualy tested with a friend, and both me and him couldn't call each other.
pawn Код:
CMD:call(playerid, params[])
{
if(PlayerInfo[playerid][Phone] == 1)
{
new number;
if(!sscanf(params, "i", number))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][PhoneNumber] == number)
{
SendClientMessage(i, COLOR_YELLOWGREEN, "Your phone is beeping, /pickup too pickup the call or /hangup if you are not willing to pickup.");
PlayerInfo[playerid][Call] = number;
PlayerInfo[i][Call] = PlayerInfo[playerid][PhoneNumber];
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You get a busy tone.");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "Usage: /call [Number]");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "You don't have a phone.");
}


