argument type mismatch (argument 3) but why?
#1

Hi all im having troubles with my script and i asking for help.
pawn Код:
These lines is the locations where the /call is writeable...

new Float:Locations[15][3] = {
{1242.5491,1425.8359,10.8203},
{1471.6235,1427.9355,10.8203},
{2112.1749,1381.4261,10.8203},
{2310.9152,1381.6161,10.8203},
{2409.4855,1381.6128,10.8203},
{2099.5593,1202.0027,10.8203},
{2395.8723,1201.8759,10.8203},
{2158.0876,1018.0305,10.8125},
{2558.1509,1014.7099,10.8125},
{2073.7469,736.9877,10.8203},
{2163.4532,704.9913,10.8280},
{2560.5582,704.9595,10.8280},
{1286.9607,1266.8053,10.8203},
{1690.6462,1266.9874,10.8203},
{1595.2450,1784.0334,10.8203}
};
pawn Код:
if(strcmp(cmd, "/call", true) == 0 || strcmp(cmd, "/tf", true) ==0 )
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, Locations[0], Locations[1], Locations[2]));
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    //SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                    SendClientMessage(playerid, COLOR_GRAD2, "Use: /call [number]");
                    return 1;
                }
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "  You should logg in.");
                    return 1;
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new phonenumb = strval(tmp);
                if(phonenumb == 911)
                {
                    SendClientMessage(playerid, COLOR_GREY, "911 is not available yet.");
                    //ShowEmergencyOneDialog(playerid,DEMERGENCY1);
                    return 1;
                }
                if(phonenumb == PlayerInfo[playerid][pPnumber])
                {
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                    SendClientMessage(playerid, COLOR_GRAD2, " The numner is busy.");
                    return 1;
                }
                if(Mobile[playerid] != 9999)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "You are already in a call.");
                    return 1;
                }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                        {
                            giveplayerid = i;
                            Mobile[playerid] = giveplayerid;
                            if(IsPlayerConnected(giveplayerid))
                            {
                                if(giveplayerid != INVALID_PLAYER_ID)
                                {
                                    if(PhoneOnline[giveplayerid] > 0)
                                    {
                                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                                        SendClientMessage(playerid, COLOR_GREY, " The number is busy,please try again later.");
                                        return 1;
                                    }

                                }
                            }
                        }
                    }
                }
                SendClientMessage(playerid, COLOR_GRAD2, " The number is busy now.");
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
            }
            return 1;
        }
    }
pawn Код:
error 035: argument type mismatch (argument 3)
The Line: if(IsPlayerInRangeOfPoint(playerid, 3.0, Locations[0], Locations[1], Locations[2]));
Where is the problem?please help me thank you.
Reply
#2

pawn Код:
new Locations = random(3);
I think that's it, something along the line of that.
Reply
#3

Remove ";" after that if statement.
Reply
#4

silvis123 Thank you, you helped meg, but the error is still exists... :S
Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
pawn Код:
new Locations = random(3);
I think that's it, something along the line of that.
Thank you for your reply, but i dont want to randomly generate these locations...If you in the range of these points you can /call... but if you not in these range of points you cant /call...

So could you help me again?
Reply
#5

Hmm not really sure, try this:

pawn Код:
new Float:Locations[][3] = {
Epic fail but I have another suggestion, use the direct coordinates in the IsPlayerInRangeOfPoint instead of using the way your using now.
Reply
#6

pawn Код:
if(strcmp(cmd, "/call", true) == 0 || strcmp(cmd, "/tf", true) ==0 )
    {
        for(new i=0;i<sizeof(Locations);i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, Locations[i][0], Locations[i][1], Locations[i][2]))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    //SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                    SendClientMessage(playerid, COLOR_GRAD2, "Use: /call [number]");
                    return 1;
                }
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "  You should logg in.");
                    return 1;
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new phonenumb = strval(tmp);
                if(phonenumb == 911)
                {
                    SendClientMessage(playerid, COLOR_GREY, "911 is not available yet.");
                    //ShowEmergencyOneDialog(playerid,DEMERGENCY1);
                    return 1;
                }
                if(phonenumb == PlayerInfo[playerid][pPnumber])
                {
                    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                    SendClientMessage(playerid, COLOR_GRAD2, " The numner is busy.");
                    return 1;
                }
                if(Mobile[playerid] != 9999)
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "You are already in a call.");
                    return 1;
                }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                        {
                            giveplayerid = i;
                            Mobile[playerid] = giveplayerid;
                            if(IsPlayerConnected(giveplayerid))
                            {
                                if(giveplayerid != INVALID_PLAYER_ID)
                                {
                                    if(PhoneOnline[giveplayerid] > 0)
                                    {
                                        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                                        SendClientMessage(playerid, COLOR_GREY, " The number is busy,please try again later.");
                                        return 1;
                                    }

                                }
                            }
                        }
                    }
                }
                SendClientMessage(playerid, COLOR_GRAD2, " The number is busy now.");
                SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
                return 1;
            }
        }
        SendClientMessage(playerid, COLOR_GRAD2, " You can't call anyone at this location.");
        return 1;
    }
This may work.
Reply
#7

^^ Wait till ****** sees that for efficiency. ^_^
Reply
#8

* willsuckformoney Slaps Double-O-Seven With a 16.7 lb Trout.

Nice Double-O-Seven
Reply
#9

Thank you all for helping me...Double-O-Seven's solution was the best :P Thx Bro'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)