how to make a payphone
#5

+Rep!

Quote:

//------------------------------PAYPHONES------------------------------------------------//
new Floatay_phone[2][3] = {

{1807.4861,-1599.31,13.5469}, // payphone 1
{1710.9800,-1604.9263,13.5469}, // payphone 2


};

stock NearestPayphone(playerid)
{

for(new i = 0; i < sizeof(pay_phone); i ++)
{

if(IsPlayerInRangeOfPoint(playerid,25.0,pay_phone[i][0],pay_phone[i][1],pay_phone[i][2]))
{

return i;

}

}
return -1;

}

COMMANDayphone(playerid,params[])
{

new pphone = NearestPayphone(playerid);
if(pphone > 0)
{
new idx = 0;
new tmp[64];
tmp = strtok(params,idx);
if(!strlen(tmp)) { SendClientMessageA(playerid,COLOR_LIGHTRED,"USAGE: /payphone [phone number]"); return 1; }
new number = strval(tmp);
if(number > 0)
{

BeginCall(playerid,number);
return 1;

}
else
{

SendErrorMsg(playerid,"Invalid phone number.");
return 1;

}
}
else
{

SendErrorMsg(playerid,"You are not near a working Payphone"); // gives me this error when im
return 1;

}

}

Reply


Messages In This Thread
how to make a payphone - by Wahyu33 - 26.01.2017, 03:20
Re: how to make a payphone - by Sew_Sumi - 26.01.2017, 03:22
Re: how to make a payphone - by Wahyu33 - 26.01.2017, 03:25
Re: how to make a payphone - by Sew_Sumi - 26.01.2017, 03:32
Re: how to make a payphone - by SuperTramp - 26.01.2017, 13:41
Re: how to make a payphone - by Sew_Sumi - 26.01.2017, 14:05

Forum Jump:


Users browsing this thread: 2 Guest(s)