Argument mismatch (argument 1)
#1

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(playeridCOLOR_GREY"No Taxi Drivers are online.");
        
SendClientMessage(playeridCOLOR_YELLOW"[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
        
SendClientMessage(playeridCOLOR_GREY"They hung up...");
        return 
1;
    } 
I also tried
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(playeridCOLOR_GREY"No Taxi Drivers are online.");
        
SendClientMessage(playeridCOLOR_YELLOW"[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
        
SendClientMessage(playeridCOLOR_GREY"They hung up...");
        return 
1;
    } 
still same error
Код:
error 035: argument type mismatch (argument 1)
full cmd:
PHP код:
CMD:call(playeridparams[]) {
    new 
numberline[240];
    if(
PlayerInfo[playerid][pInjured] > 0) return SendClientMessage(playeridCOLOR_GREY"You cannot do that at the moment.");
    if(
sscanf(params"i"number)) return SendClientMessage(playeridCOLOR_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(playeridCOLOR_GREY"No Taxi Drivers are online.");
        
SendClientMessage(playeridCOLOR_YELLOW"[Taxi Service]{FFFFFF} Your call has been sent to all taxi drivers, wait until they accept.");
        
SendClientMessage(playeridCOLOR_GREY"They hung up...");
        return 
1;
    }
    if(
PlayerInfo[playerid][pPhone] == 0) return SendClientMessage(playeridCOLOR_ORANGE"Error: {ffffff}You don't have a phone.");
    if(
PlayerInfo[playerid][pCash] <= 50) return SendClientMessage(playeridCOLOR_ORANGE"Error: {ffffff}You do not have $50 to call.");
    if(
number == 0) return SendClientMessage(playeridCOLOR_GREY"[Cellphone] {FFFFFF}This number isn't valid.");
    new 
id GetPlayerIDPhone(number);
    if(
id == -1) return SendClientMessage(playeridCOLOR_ORANGE"Error: {ffffff}Couldn't connect...");
    if(
CellPhone[id][InCall]<=1) return SendClientMessage(playeridCOLOR_GREY"[Cellphone] {ffffff}You received a busy tone...");
    if(
id == playerid) return SendClientMessage(playeridCOLOR_ORANGE"Error: {FFFFFF}You can't call yourself.");
    
format(linesizeof(line), "** Calling %s [%d]...**"PlayerICName(id), PlayerInfo[id][pPhone]);
    
SendClientMessage(playeridCOLOR_YELLOWline);
    
GiveMoney(playerid, -50);
    
PlayerPlaySound(playerid36000.00.00.0);
    
CellPhone[id][PhoneRinging] =1;
    
CellPhone[id][CalledBy] = playerid;
    
CellPhone[playerid][PhoneRinging] = 1;
    
format(linesizeof(line), "** Incoming call from %d...**"PlayerInfo[playerid][pPhone]);
    
SendClientMessage(idCOLOR_YELLOWline);
    
SendClientMessage(idCOLOR_YELLOW"** /p to receive the call || /h to decline the call **");
    
CellPhone[playerid][CalledBy] = id;
    return 
1;

Reply
#2

I'm gonna assume it's the number your trying to call try this:

Код:
    if(sscanf(params, "i", number)) return SendClientMessage(playerid, COLOR_GREY, "Usage:{FFFFFF} /call [phone number]"); 
    if(number == 511) {
Since your using sscanf and assigned it as an "i" it's already an expected integer number.
Reply
#3

Код:
if(strval(number)=="511"){
Try this
Код:
if(number == 511){
You don't need the strval and the quotation marks, you are already using sscanf.
Reply
#4

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
Код:
if(strval(number)=="511"){
Try this
Код:
if(number == 511){
You don't need the strval and the quotation marks, you are already using sscanf.
Код:
error 033: array must be indexed (variable "-unknown-")
Reply
#5

if(!strcmp(number,"511"))
Reply
#6

Quote:
Originally Posted by akib
Посмотреть сообщение
Код:
error 033: array must be indexed (variable "-unknown-")
Код:
    if(number == 511)
    {
    	// do something
        return 1; 
    }
P.S: make sure you removed the quotation marks
Reply
#7

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
Код:
    if(number == 511)
    {
    	// do something
        return 1; 
    }
P.S: make sure you removed the quotation marks
Thanks it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)