27.03.2016, 09:14
Errors: It's shows to me a warning from every line in the mode, I can't post all of them, here is just 2 of them
Taxi Variables:
/Service:
/accept: The /accept caused the bug, if I remove the taxi function, the errors disappear
Код:
D:\samp037_svr_R2-1-1_win32\pawno\include\y_amx.inc(435) : warning 219: local variable "idx" shadows a variable at a preceding level D:\samp037_svr_R2-1-1_win32\gamemodes\UGRP.pwn(14750) : error 035: argument type mismatch (argument 2) 26 Errors.
Код:
// Taxi new OrderedTaxi[MAX_PLAYERS]; new AcceptedTaxi[MAX_PLAYERS];
Код:
if(!strcmp(params, "taxi", true))
{
if(OrderedTaxi[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Thank you for calling a Taxi, we will send your request to the available drivers. \nThey hang up..");
OrderedTaxi[playerid] = 1;
foreach(Player, i)
{
if(IsATaxidriver(i))
{
format(string,sizeof(string),"%s is looking for a taxi driver, /accept taxi [%d] to follow his request. ",RPN(playerid), playerid);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You have already ordered a Taxi, be patient.");
}
}
Код:
else if(!strcmp(params, "taxi", true))
{
new playerb;
if(sscanf(params, "params[4]", params, playerb)) return SendClientMessage(playerid, COLOR_GREY, "/accept taxi [ID]");
if(AcceptedTaxi[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You have already accepted a taxi call.");
if(!IsATaxidriver(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not a Taxi driver.");
if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(OrderedTaxi[playerb])
{
format(string, sizeof(string), "You have accepted %s's Taxi request, He is now marked on your radar", RPN(playerb));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Taxi Driver %s is now on his way to you", RPN(playerid));
SendClientMessage(playerb, COLOR_YELLOW, string);
CP[playerid] = 8779;
AcceptedTaxi[playerid] = 1;
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(playerb, PosX, PosY, PosZ);
SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 4.0);
return 1; }
}
else if(!OrderedTaxi[playerb])
{
SendClientMessage(playerid, COLOR_GREY, "This player hasn't ordered a Taxi");
return 1;
}
}



