SA-MP Forums Archive
Problem with /whoisrc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with /whoisrc (/showthread.php?tid=165290)



Problem with /whoisrc - KennethRandall - 04.08.2010

Aiiight, ok, I want to check if a player is in a RC vehicle, if he is, admins get a message, but the problem is, also if you are in an Airplane you see it, hope you can help me:

pawn Код:
if(strcmp(cmd, "/whoisrc", true) == 0)
    {
        if(xxxxxx[playerid][xxxx] >= 1 || IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid, COLOR_GREEN,"Players in a RC vehicle");
            new found, playername[MAX_PLAYER_NAME];
            for(new i=0; i <= GetMaxPlayers(); i++)
            {
                if(IsPlayerConnected(i))
                {
                    GetPlayerName(i, playername, MAX_PLAYER_NAME);
                    new bool:searched = false;
                    if(searched != true)
                    {
                        if(IsPlayerInAnyVehicle(i))
                        {
                            if(GetVehicleModel(GetPlayerVehicleID(i) == 441 || 464 || 465 || 501 || 564 || 594))
                            {
                                found++;
                                format(string,sizeof(string),"Player: %s(%d) - RC Vehicle: %s", playername, i, VehNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
                                SendClientMessage(playerid, COLOR_GREEN,string);
                                searched = true;
                            }
                            else searched = false;
                        }
                    }
                }
            }
            if(found == 0) SendClientMessage(playerid, COLOR_GREEN, "There are no players in a RC vehicle");
        }
        else return 0;
        return 1;
    }



Re: Problem with /whoisrc - Retardedwolf - 04.08.2010

So whats wrong?

You gotta tell us what errors you get or something.


Re: Problem with /whoisrc - KennethRandall - 04.08.2010

Quote:
Originally Posted by EllipseRage
Посмотреть сообщение
So whats wrong?

You gotta tell us what errors you get or something.
There are no errors, but if I am ingame, and I use /whoisrc
It says:
Quote:

Players in RC vehicle
Player: Myname | RC Vehicle: Beagle

How to solve that? It checks also for other vehicles..

Also used IsPlayerInVehicle, didn't work also..


Re: Problem with /whoisrc - Calgon - 04.08.2010

Код:
if(GetVehicleModel(GetPlayerVehicleID(i)) == 441 || GetVehicleModel(GetPlayerVehicleID(i)) == 464 || GetVehicleModel(GetPlayerVehicleID(i)) == 465 || GetVehicleModel(GetPlayerVehicleID(i)) == 501 || GetVehicleModel(GetPlayerVehicleID(i)) == 564 || GetVehicleModel(GetPlayerVehicleID(i)) == 594)
Try that.


Re: Problem with /whoisrc - KennethRandall - 04.08.2010

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Код:
if(GetVehicleModel(GetPlayerVehicleID(i)) == 441 || GetVehicleModel(GetPlayerVehicleID(i)) == 464 || GetVehicleModel(GetPlayerVehicleID(i)) == 465 || GetVehicleModel(GetPlayerVehicleID(i)) == 501 || GetVehicleModel(GetPlayerVehicleID(i)) == 564 || GetVehicleModel(GetPlayerVehicleID(i)) == 594)
Try that.
Thank you SO much, this worked fabulous


Re: Problem with /whoisrc - Retardedwolf - 04.08.2010

Edited. Calgon fixed his problem.