Page 1 of 1

plzzz help ar telefona skriptu

Posted: 21 Jul 2008, 15:13
by Scootsz
plzz palidzat es noka4aju skriptu kur ir kjip var runat pa telefonu bet neraada ka piem es uzpiezhu lai zvana bet man nerada ka es zvanu bet isteniba zvana un nerada ka man kads zvana bet patiesiba zvana. es prasiju tam kursh veidoja skriptu vinjsh neatbildeja. plzz help

Code: Select all

 #include 
#define COLOR_CALL 0xBFC0C2FF
#define COLOR_YELLOW 0xFFFF00AA

#define DEAD_TIMER_ID -666

#define LIBRE 0
#define ESTA_LLAMANDO 1
#define LO_ESTAN_LLAMANDO 2
#define ESTA_HABLANDO 3
//------------------------------------------------------------------------------
//               HOW MUCH MONEY COST A SECOND
#define PRECIO_FICHA 2
#define COSTO_SMS 50
//This is the distance from where ppl can here what you say to the phone, set it
//to -1 if you don't want ppl to hear phone calls (NON REALISTIC)
#define DIST 20.0
//------------------------------------------------------------------------------
new CellState[MAX_PLAYERS];
new AuxiliarTel[MAX_PLAYERS];
new CellTime[MAX_PLAYERS];
new TimerLLamando[MAX_PLAYERS]={DEAD_TIMER_ID,...};
new TimerCaidaFicha[MAX_PLAYERS]={DEAD_TIMER_ID,...};
new Numero_Tel[MAX_PLAYERS];
//Memoria telefono -------------------------------------------------------------
enum Memory_slot_salida{
	numero_telefono,
	Nombre[MAX_PLAYER_NAME],
	costo
	};
new MemorySalida[MAX_PLAYERS][5][Memory_slot_salida];

enum Memory_slot_entrada{
	numero_telefono2,
	Nombre2[MAX_PLAYER_NAME]
	};
new MemoryEntrada[MAX_PLAYERS][5][Memory_slot_entrada];
//Memoria SMS ------------------------------------------------------------------
enum sms_slot_enviados{
	numeroSMS1,
	NombreSMS1[MAX_PLAYER_NAME],
	SMS1[120]
	};
new SMSEnviados[MAX_PLAYERS][5][sms_slot_enviados];
enum sms_slot_recibidos{
	numeroSMS2,
	NombreSMS2[MAX_PLAYER_NAME],
	SMS2[120]
	};
new SMSRecibidos[MAX_PLAYERS][5][sms_slot_recibidos];
//------------------------------------------------------------------------------
forward ColgarTelefonino(playerid);
forward Llamando(callerid,receiverid);
forward CaidaDeFicha(playerid);
//------------------------------------------------------------------------------
public CaidaDeFicha(playerid)
{
    CellTime[playerid]++;
    if (CellTime[playerid]*PRECIO_FICHA>GetPlayerMoney(playerid))
    {
        OnPlayerCommandText(playerid,"/h");
        msgInfo(playerid,"You don't have money left$$$$");
    }
}
//------------------------------------------------------------------------------
msgInfo(playerid,text[])
{
	new msg[255];
    format(msg,255,"   %s",text);
    SendClientMessage(playerid, COLOR_YELLOW, msg);
    return 1;
}
//------------------------------------------------------------------------------------------------------
Float:GetDistanceToPoint(playerid,Float:x2,Float:y2,Float:z2)
{
	if (IsPlayerConnected(playerid))
	{
		new Float:x1,Float:y1,Float:z1;
		GetPlayerPos(playerid,x1,y1,z1);
		return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
	}
	return 9999.9;
}
//------------------------------------------------------------------------------
AlTelefono(playerid,text[])
{
    new msg[255];
    format(msg,255,"   (cellphone)%s",text);
    SendClientMessage(playerid, COLOR_CALL, msg);
    return 1;
}
//------------------------------------------------------------------------------
public OnFilterScriptInit()
{
	print(" Celular FS zeruel_angel");
	return 1;
}
//------------------------------------------------------------------------------
public Llamando(callerid,receiverid)
{
	if ((!IsPlayerConnected(receiverid))&&(IsPlayerConnected(callerid)))
	{
	    msgInfo(callerid,"The player you were calling is not connected anymore.");
	    if  (TimerLLamando[callerid]!=DEAD_TIMER_ID)
	    {
	    	KillTimer(TimerLLamando[callerid]);
	    	TimerLLamando[callerid]=DEAD_TIMER_ID;
	    	TimerLLamando[receiverid]=DEAD_TIMER_ID;
	    	CellState[callerid]=LIBRE;
	    	CellState[receiverid]=LIBRE;
		}
		return 1;
	}
	if ((IsPlayerConnected(receiverid))&&(!IsPlayerConnected(callerid)))
	{
	    msgInfo(receiverid,"The player who were calling you is not connected anymore.");
	    if  (TimerLLamando[receiverid]!=DEAD_TIMER_ID)
	    {
	    	KillTimer(TimerLLamando[receiverid]);
	    	TimerLLamando[callerid]=DEAD_TIMER_ID;
	    	TimerLLamando[receiverid]=DEAD_TIMER_ID;
	    	CellState[callerid]=LIBRE;
	    	CellState[receiverid]=LIBRE;
		}
		return 1;
	}
	if ((!IsPlayerConnected(receiverid))&&(!IsPlayerConnected(callerid)))
	{
	    if  (TimerLLamando[callerid]!=DEAD_TIMER_ID)
	    {
	    	KillTimer(TimerLLamando[callerid]);
		}
  		if  (TimerLLamando[receiverid]!=DEAD_TIMER_ID)
	    {
	    	KillTimer(TimerLLamando[receiverid]);
		}
		TimerLLamando[callerid]=DEAD_TIMER_ID;
 		TimerLLamando[receiverid]=DEAD_TIMER_ID;
 		CellState[callerid]=LIBRE;
  		CellState[receiverid]=LIBRE;
  		return 1;
	}
	if  ((CellState[callerid] == ESTA_LLAMANDO)&&(CellState[receiverid] == LO_ESTAN_LLAMANDO))
	{
		new msg[256];
		new callerName[MAX_PLAYER_NAME];
		msgInfo(callerid,"Calling...");
	    GetPlayerName(callerid, callerName, sizeof(callerName));
	    format(msg, sizeof(msg), "RING! RING! (cellphone).pickup(/p) hangup(/h). caller: %s (N°%d)", callerName,Numero_Tel[callerid]);
		msgInfo(receiverid, msg);
		new Float:x1,Float:y1,Float:z1;
		GetPlayerPos(receiverid,x1,y1,z1);
		for (new i=0;i");
	    msgInfo(playerid, "/mynumber or /mn (in order to know your cellphone number)");
	    msgInfo(playerid, "/memory1 o /mm1(call outs) /memory2 o /mm2 (call ins)");
	    msgInfo(playerid, "/sms [phone number] [text] (send a SMS)");
	    msgInfo(playerid, "/smsIN (IN BOX) /smsOUT(SEND BOX)");
	    msgInfo(playerid, "/CALL [phone number] (to call someone)");
	    msgInfo(playerid, "/Hangup o /h (to hangup the phone)");
	    msgInfo(playerid, "/pickup o /p (to pick up a call)");
	    msgInfo(playerid, "");
	    return 1;
	}
    if( (strcmp(cmd, "/mynumber", true) == 0) || (strcmp(cmd, "/mn", true) == 0) )
    {
		format(tmp,sizeof(tmp),"Your phone number is: %d",Numero_Tel[playerid]);
		msgInfo(playerid, tmp);
		return 1;
    }
    if( (strcmp(cmd, "/memory1", true) == 0) || (strcmp(cmd, "/mm1", true) == 0) )
    {
        msgInfo(playerid, "    Calls made:");
        for (new i=0;i0;i--)
	{
	    MemorySalida[playerid][i][numero_telefono]=MemorySalida[playerid][i-1][numero_telefono];
	    format(MemorySalida[playerid][i][Nombre],MAX_PLAYER_NAME,"%s",MemorySalida[playerid][i-1][Nombre]);
		MemorySalida[playerid][i][costo]=MemorySalida[playerid][i-1][costo];
	}
	MemorySalida[playerid][0][numero_telefono]=Numero_Tel[otroplayerid];
	GetPlayerName(otroplayerid,MemorySalida[playerid][0][Nombre],MAX_PLAYER_NAME);
	MemorySalida[playerid][0][costo]=CellTime[playerid]*PRECIO_FICHA;
	return 1;
}
//------------------------------------------------------------------------------
ActualizarMemoriaEntrada(playerid,otroplayerid)
{
    msgInfo(playerid, "Some is calling you, pickup(/p) hangup(/h)...");
    msgInfo(playerid, "Your phone is ringing ( /p )");
	for (new i=4;i>0;i--)
	{
	    MemoryEntrada[playerid][i][numero_telefono2]=MemoryEntrada[playerid][i-1][numero_telefono2];
		format(MemoryEntrada[playerid][i][Nombre2],MAX_PLAYER_NAME,"%s",MemoryEntrada[playerid][i-1][Nombre2]);
	}
	MemoryEntrada[playerid][0][numero_telefono2]=Numero_Tel[otroplayerid];
	GetPlayerName(otroplayerid,MemoryEntrada[playerid][0][Nombre2],MAX_PLAYER_NAME);
	return 1;
}
//------------------------------------------------------------------------------
SMSIN(numTel,otroplayerid,texto[])
{
	new playerid = ConectarLLamada(numTel);
	if (IsPlayerConnected(playerid))
	{
	    msgInfo(playerid, "You have 1 new SMS ( /smsIN )");
		for (new i=4;i>0;i--)
		{
		    SMSRecibidos[playerid][i][numeroSMS2]=SMSRecibidos[playerid][i-1][numeroSMS2];
			format(SMSRecibidos[playerid][i][NombreSMS2],MAX_PLAYER_NAME,"%s",SMSRecibidos[playerid][i-1][NombreSMS2]);
			format(SMSRecibidos[playerid][i][SMS2],120,"%s",SMSRecibidos[playerid][i-1][SMS2]);
		}
		SMSRecibidos[playerid][0][numeroSMS2]=Numero_Tel[otroplayerid];
		GetPlayerName(otroplayerid,SMSRecibidos[playerid][0][NombreSMS2],MAX_PLAYER_NAME);
		format(SMSRecibidos[playerid][0][SMS2],120,"%s",texto);
	}
	return 1;
}
//------------------------------------------------------------------------------
SMSOUT(playerid,numTel,texto[])
{
	new otroplayerid = ConectarLLamada(numTel);
    msgInfo(playerid, "Your phone is ringing ( /p )");
	msgInfo(playerid, "Some is calling you, pickup(/p) hangup(/h)...");
	for (new i=4;i>0;i--)
	{
	    SMSEnviados[playerid][i][numeroSMS1]=SMSEnviados[playerid][i-1][numeroSMS1];
		format(SMSEnviados[playerid][i][NombreSMS1],MAX_PLAYER_NAME,"%s",SMSEnviados[playerid][i-1][NombreSMS1]);
		format(SMSEnviados[playerid][i][SMS1],120,"%s",SMSEnviados[playerid][i-1][SMS1]);
	}
	if (IsPlayerConnected(otroplayerid)) GetPlayerName(otroplayerid,SMSEnviados[playerid][0][NombreSMS1],MAX_PLAYER_NAME);
	else format(SMSEnviados[playerid][0][NombreSMS1],MAX_PLAYER_NAME,"%s"," FAILURE ");
 	SMSEnviados[playerid][0][numeroSMS1]=numTel;
	format(SMSEnviados[playerid][0][SMS1],120,"%s",texto);
	return 1;
}
//------------------------------------------------------------------------------
borrarMemorias(playerid)
{
	for (new i=0;i ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
//------------------------------------------------------------------------------
stock strcpy( dest[ ], src[ ], startdest = 0, startsrc = 0 )
{
        // Made by Peter.

        for ( new i = startsrc, j = strlen( src ); i < j; i++ )
        {
                dest[ startdest++ ] = src[ i ];
        }
        dest[ startdest ] = 0;
}

Re: plzzz help ar telefona skriptu

Posted: 21 Jul 2008, 15:39
by Reperis_dTb
Esmu nedaudz atpalicis :D Ko tas Telefons script dod ? |:)

Re: plzzz help ar telefona skriptu

Posted: 22 Jul 2008, 18:16
by SaW
Labāk ieliec uz pastebin.com