"You are not around that player !"
#1

Hello guys, I use this command which allows the cops to /p checkbelt to see if the player in car have his seatbelt or not.

The thing is, it's always saying "You are not around that player !" (see the end of the code). Why that ?
Oh and I've 2 warnings too :

Код:
C:\Users\Geo\Desktop\Ca marche\a jour\gamemodes\lairp.pwn(20720) : warning 202: number of arguments does not match definition
C:\Users\Geo\Desktop\Ca marche\a jour\gamemodes\lairp.pwn(20724) : warning 202: number of arguments does not match definition
pawn Код:
if(strcmp(subcmd, "checkbelt", true) == 0)
            {
                new playa;
                new newcar = GetPlayerVehicleID(playa);
                new sendername[MAX_PLAYER_NAME];
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkseatbelt [playerid]");
                    return 1;
                }
                if(strlen(tmp))
                {
                    playa = ReturnUser(tmp);
                }
                else
                {
                    playa = strval(tmp);
                }
                if(GetPlayerState(playa) == PLAYER_STATE_ONFOOT)
                {
                    SendClientMessage(playerid,COLOR_GREY,"The player is not in any vehicle");
                    return 1;
                }
                if(IsABike(newcar))
                {
                    SendClientMessage(playerid,COLOR_GRAD2," That vehicle does not have a seatbelt !");
                    return 1;
                }
                GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                GetPlayerName(playerid, sendername, sizeof(sendername));

                if (PlayerInfo[playerid][pMember] != 5)
                {
                    SendClientMessage(playerid,COLOR_GREY,"You are not a cop");
                    return 1;
                }
                if (ProxDetectorS(9.0, playerid, giveplayerid))
                {
                    new stext[255];
                    if(PlayerInfo[playa][pSeatBelt] == 0)
                    {
                        stext = "Off";
                    }
                    else if(PlayerInfo[playa][pSeatBelt] != 1)
                    {
                        stext = "On";
                    }
                    format(string, sizeof(string), "%s seat belt is currently %s" , giveplayer , stext);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    SendClientMessage(playerid,COLOR_WHITE,string);
                    new string2[255];
                    format(string2, sizeof(string2), "* %s has checked %s for wearing a selt belt.", sendername ,giveplayer);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "you are not around that player!");
                }
                return 1;
            }





Ligne 20720 & 20724 for the warnings :

pawn Код:
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

Thank you in advance.
Reply
#2

I up the thread.
Reply
#3

Couldnt find a error, but delete new string2[255]; and just format string again, rest looks as need, could be you have edited ProxDetector function?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)