16.09.2014, 23:46
So i've created a script for phone system, and it's not working whenever i enter the right number it shows me the error i don't know what the heck is wrong..
pawn Код:
CMD:call(playerid, params[])
{
new number, str[250], caller = PI[playerid][PhNumber];
if(sscanf(params, "d", number)) return SCM(playerid, GREY, "Use: /call [num]");
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(PI[i][PhNumber] == number)
{
if(TalkingWith[i] == 1) return SCM(playerid, TOMATO, " (error) {FFFFFF}This player is already talking with someone !");
if(InCall[i] == 1) return SCM(playerid, TOMATO, " (error) {FFFFFF}Someone is already calling this player !");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
Mobile[playerid] = i;
SCMF(i, WHITE, "Your cellphone is ringing - use '/pickup' to answer, caller: %d", caller);
format(str, sizeof(str), "* %s's phone is ringing.", PlayerName(i));
ProxDetector(10.0, playerid, str, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
InCall[i] = 1;
}
else
{
SCM(playerid, TOMATO, " (error) {FFFFFF}The number you're calling is wrong or currently busy.");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
SetPlayerSpecialAction(playerid, 0);
ClearAnimations(playerid);
return 1;
}
}
}
return 1;
}