07.03.2014, 19:23
(
Последний раз редактировалось daminOwens; 07.03.2014 в 20:06.
)
Im tryin to make add payphones to my script this is what i have so far .. i have trouble its just telling me when im go to the point i specified as a payphone i recieve the send error "you are not at a working payphone"
so im not sure why ists not recognizing that im inrange of payphone
**any help would be nice im kinda new at this have dove head first...
so im not sure why ists not recognizing that im inrange of payphone
pawn Код:
//------------------------------PAYPHONES------------------------------------------------//
new Float:pay_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;
}
COMMAND:payphone(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;
}
}