26.01.2017, 13:41
+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; } } |