01.04.2019, 02:54
PHP код:
if(!strcmp("511", strval(number))){
new count;
for(new i=0;i<MAX_PLAYERS;i++){
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][pJob] != JOB_TAXIDRIVER) continue;
SendClientMessageEx(i,COLOR_YELLOW,"[Taxi Call]{FFFFFF} %s is requesting pickup at %s (/taxicalls)", PlayerICName(playerid),GetPlayerLocation(playerid));
count++;
}
if(count<=0) return SendClientMessage(playerid, COLOR_GREY, "No Taxi Drivers are online.");
SendClientMessage(playerid, COLOR_YELLOW, "[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
SendClientMessage(playerid, COLOR_GREY, "They hung up...");
return 1;
}
PHP код:
if(strval(number)=="511"){
new count;
for(new i=0;i<MAX_PLAYERS;i++){
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][pJob] != JOB_TAXIDRIVER) continue;
SendClientMessageEx(i,COLOR_YELLOW,"[Taxi Call]{FFFFFF} %s is requesting pickup at %s (/taxicalls)", PlayerICName(playerid),GetPlayerLocation(playerid));
count++;
}
if(count<=0) return SendClientMessage(playerid, COLOR_GREY, "No Taxi Drivers are online.");
SendClientMessage(playerid, COLOR_YELLOW, "[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
SendClientMessage(playerid, COLOR_GREY, "They hung up...");
return 1;
}
Код:
error 035: argument type mismatch (argument 1)
PHP код:
CMD:call(playerid, params[]) {
new number, line[240];
if(PlayerInfo[playerid][pInjured] > 0) return SendClientMessage(playerid, COLOR_GREY, "You cannot do that at the moment.");
if(sscanf(params, "i", number)) return SendClientMessage(playerid, COLOR_GREY, "Usage:{FFFFFF} /call [phone number]");
if(strval(number)=="511"){
new count;
for(new i=0;i<MAX_PLAYERS;i++){
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][pJob] != JOB_TAXIDRIVER) continue;
SendClientMessageEx(i,COLOR_YELLOW,"[Taxi Call]{FFFFFF} %s is requesting pickup at %s (/taxicalls)", PlayerICName(playerid),GetPlayerLocation(playerid));
count++;
}
if(count<=0) return SendClientMessage(playerid, COLOR_GREY, "No Taxi Drivers are online.");
SendClientMessage(playerid, COLOR_YELLOW, "[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
SendClientMessage(playerid, COLOR_GREY, "They hung up...");
return 1;
}
if(PlayerInfo[playerid][pPhone] == 0) return SendClientMessage(playerid, COLOR_ORANGE, "Error: {ffffff}You don't have a phone.");
if(PlayerInfo[playerid][pCash] <= 50) return SendClientMessage(playerid, COLOR_ORANGE, "Error: {ffffff}You do not have $50 to call.");
if(number == 0) return SendClientMessage(playerid, COLOR_GREY, "[Cellphone] {FFFFFF}This number isn't valid.");
new id = GetPlayerIDPhone(number);
if(id == -1) return SendClientMessage(playerid, COLOR_ORANGE, "Error: {ffffff}Couldn't connect...");
if(CellPhone[id][InCall]<=1) return SendClientMessage(playerid, COLOR_GREY, "[Cellphone] {ffffff}You received a busy tone...");
if(id == playerid) return SendClientMessage(playerid, COLOR_ORANGE, "Error: {FFFFFF}You can't call yourself.");
format(line, sizeof(line), "** Calling %s [%d]...**", PlayerICName(id), PlayerInfo[id][pPhone]);
SendClientMessage(playerid, COLOR_YELLOW, line);
GiveMoney(playerid, -50);
PlayerPlaySound(playerid, 3600, 0.0, 0.0, 0.0);
CellPhone[id][PhoneRinging] =1;
CellPhone[id][CalledBy] = playerid;
CellPhone[playerid][PhoneRinging] = 1;
format(line, sizeof(line), "** Incoming call from %d...**", PlayerInfo[playerid][pPhone]);
SendClientMessage(id, COLOR_YELLOW, line);
SendClientMessage(id, COLOR_YELLOW, "** /p to receive the call || /h to decline the call **");
CellPhone[playerid][CalledBy] = id;
return 1;
}