Sziasztok!
Bendor csinált egy telefont rendszert:
http://sampforum.hu/index.php?topic=33053.0Az a baj vele ha a pickupra megyek nem történik semmi. Mivel nem ír vissza ezért hozzátok fordulok.
Itt a kód:
#define FILTERSCRIPT
#include <a_samp>
#include zcmd
#include Dini
#include sscanf
#include btel
#pragma tabsize 0
#pragma unused ret_memcpy
new call[MAX_PLAYERS];
new pickup;
new Float:xtel = 0.0,
Float:ytel = 0.0,
Float:ztel = 3.0;
new tpickup;
enum number
{
Number
}
new PhoneNumber[MAX_PLAYERS][number];
public OnFilterScriptInit()
{
pickup = AddStaticPickup(1318,2,xtel,ytel,ztel,-1);
return 1;
}
public OnPlayerConnect(playerid)
{
PhoneNumber[playerid][Number] = GetPlayerNumber(playerid);
return 1;
}
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == pickup)
{
if(GetPlayerHavePhone(playerid) == 0)
{
ShowPlayerDialog ( playerid, 1, DIALOG_STYLE_LIST, \"BTel Kereskedés\", \"Nokia 3310\\nSamsung Galaxy Mini\\niPhone\",\"\",\"Kilépés\" );
if(GetPlayerMoney(playerid) < 100)
{
SendClientMessage(playerid,0xfc0a0aAA,\"Nincs elég pénzed!\");
}
else
{
ShowPlayerDialog ( playerid, 1, DIALOG_STYLE_LIST, \"BTel Kereskedés\", \"Nokia 3310\\nSamsung Galaxy Mini\\niPhone\",\"\",\"Kilépés\" );
}
}
else if(GetPlayerHavePhone(playerid) == 1)
{
SendClientMessage(playerid,0xfc0a0aAA,\"Neked már van telefonod! Eldobáshoz: /dropphone\");
}
if(pickupid == tpickup)
{
SetPlayerHavePhone(playerid,true);
}
}
return 1;
}
public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext [ ] )
{
if (dialogid == 1 )
{
if ( !response )
{
SendClientMessage ( playerid, 0xFF0000FF, \"Elhagytad a kereskedést!\" );
return 1;
}
if ( listitem == 0 )
{
if(GetPlayerMoney(playerid) < 20)
{
SendClientMessage(playerid,0xfc0a0aAA,\"Nincs elég pénzed!\");
}
else
{
GivePlayerMoney(playerid,-20);
SetPlayerPhoneStyle(playerid,0);
SetPlayerHavePhone(playerid,true);
GenTelNum(playerid);
SendClientMessage(playerid,0xfc0a0aAA,\"Megvetted a Nokia 3310-et!\");
}
}
if ( listitem == 1 )
{
if(GetPlayerMoney(playerid) < 50)
{
SendClientMessage(playerid,0xfc0a0aAA,\"Nincs elég pénzed!\");
}
else
{
GivePlayerMoney(playerid,-50);
SetPlayerPhoneStyle(playerid,1);
SetPlayerHavePhone(playerid,true);
GenTelNum(playerid);
SendClientMessage(playerid,0xfc0a0aAA,\"Megvetted a Samsung Galaxy Mini-t!\");
}
}
if ( listitem == 2 )
{
if(GetPlayerMoney(playerid) < 100)
{
SendClientMessage(playerid,0xfc0a0aAA,\"Nincs elég pénzed!\");
}
else
{
GivePlayerMoney(playerid,-100);
SetPlayerPhoneStyle(playerid,2);
SetPlayerHavePhone(playerid,true);
GenTelNum(playerid);
SendClientMessage(playerid,0xfc0a0aAA,\"Megvetted az iPhone-t!\");
}
}
return 1;
}
if (dialogid == 2 )
{
if ( !response )
{
SendClientMessage ( playerid, 0xFF0000FF, \"Kiléptél a zenelejátszóból!\" );
return 1;
}
if ( listitem == 0 )
{
// ide jön a zene,így : PlayAudioStreamForPlayer(playerid, \"http://asd.com/asd.mp3\");
}
if ( listitem == 1 )
{
// ide jön a zene,így : PlayAudioStreamForPlayer(playerid, \"http://asd.com/asd.mp3\");
}
if ( listitem == 2 )
{
// ide jön a zene,így : PlayAudioStreamForPlayer(playerid, \"http://asd.com/asd.mp3\");
}
return 1;
}
return 0;
}
public OnPlayerText(playerid, text[])
{
if(call[playerid] == 1)
{
new hivas[128];
format(hivas, sizeof (hivas), \"((Hívásban))%s: %s\",Nev(playerid), text);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(call == 1)
{
SendClientMessage(i,0xffffffaa,hivas);
}
}
return 0;
}
else return 1;
}
CMD:musicoff(playerid,params[])
{
StopAudioStreamForPlayer(playerid);
return 1;
}
CMD:mp3(playerid,params[])
{
ShowPlayerDialog ( playerid, 2, DIALOG_STYLE_LIST, \"iTunes\", \"Rap\\nPOP\\nRock\",\"\",\"Kilépés\" );
return 1;
}
CMD:dropphone(playerid,params[])
{
new Float:xt,Float:yt,Float:zt;
SetPlayerHavePhone(playerid,false);
SendClientMessage(playerid,0xfc0a0aAA,\"Eldobtad a telefonod!\");
tpickup = AddStaticPickup(1318,2,xt,yt,zt,-1);
return 1;
}
CMD:ignore(playerid,params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
call[playerid] = 1;
call = 1;
}
return 1;
}
CMD:call(playerid,params[])
{
new numb,pid;
if(sscanf(params, \"i\",numb)) return SendClientMessage(playerid, 0xfc0a0aAA, \"Használat: /call telefonszám\");
if(GetPlayerPhoneStatus(playerid) == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PhoneNumber[Number] == numb)
{
pid = i;
call[playerid] = 1;
call[pid] = 1;
}
}
}
else
{
SendClientMessage(playerid, 0xfc0a0aAA, \"Ki van kapcsolva az illetõ mobilja!\");
}
return 1;
}
CMD:sms(playerid,params[])
{
new id,text,string[128],numb;
if(sscanf(params, \"is[128]\",numb,text)) return SendClientMessage(playerid, 0xfc0a0aAA, \"Használat: /sms id üzenet\");
if(GetPlayerPhoneStatus(playerid) == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PhoneNumber[Number] == numb)
{
id = i;
if(GetPlayerPhoneStatus(playerid) == 1)
{
format(string,sizeof(string),\"%s smse:%s\",Nev(playerid),text);
SendClientMessage(id,0xfc0a0aAA,string);
}
}
}}
else
{ SendClientMessage(playerid, 0xfc0a0aAA, \"Ki van kapcsolva a mobilod!\"); }
return 1;
}
CMD:jegyzetir(playerid,params[])
{
if(GetPlayerHavePhone(playerid) == 1)
{
if(GetPlayerPhoneStatus(playerid) == 1)
{
if(GetPlayerPhoneStyle(playerid) >= 1 )
{
new text[128];
if(sscanf(params, \"ui\",text)) return SendClientMessage(playerid, 0xfc0a0aAA, \"Használat: /jegyzet text\");
format(File, sizeof(File), \"User/%s.ini\", Nev(playerid));
GetPlayerPhoneStyle(playerid);
dini_Set(File,\"Jegyzet\",text);
}
else SendClientMessage(playerid, 0xfc0a0aAA, \"Nincs hozzá megfelelõ telefonod!\");
}
else SendClientMessage(playerid, 0xfc0a0aAA, \"Nincs hozzá megfelelõ telefonod!\"); }
else SendClientMessage(playerid, 0xfc0a0aAA, \"Nincs telefonod!\");
return 1;
}
CMD:jegyzetolv(playerid,params[])
{
new string[128];
format(File, sizeof(File), \"User/%s.ini\", Nev(playerid));
format(string,sizeof(string),\"Jegyzeted:%s\",dini_Get(File,\"Jegyzet\"));
SendClientMessage(playerid,0xffffffaa,string);
return 1;
}
Remélem tudtok segíteni.