Remote function
#3

Quote:
Originally Posted by KubiPL
Посмотреть сообщение
CallRemoteFunction will return always 1 if it execute success.
Just replace

with
Its still doesn't work..

I had to change the stock name too because if I would not change it, it says undefined symbol...

Updated script:

pawn Код:
stock IsACop(playerid)
{
    return CallRemoteFunction("IsACop", "i", playerid);
}

CheckPlayerSpeeding(playerid)
{
    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        if (!IsACop(playerid))
            {
            // Loop through all speedcameras
            for (new CamID; CamID < MAX_CAMERAS; CamID++)
            {
                // Check if this camera has been created
                if (ACameras[CamID][CamSpeed] != 0)
                {
                    // Check if the player is the driver of the vehicle
                    if (GetPlayerVehicleSeat(playerid) == 0)
                    {
                        // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                        if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                        {
                            // Check if the player is near the camera
                            if (IsPlayerInRangeOfPoint(playerid, 20.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                            {
                                APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                                SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Speed Cam has given you a ticket costing $2500, reason: High Speed");
                                GivePlayerCash(playerid, -2500);
                            }
                        }
                    }
                }
            }
        }
    }
    else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
        APlayerData[playerid][PlayerCaughtSpeeding]--;
    return 1;
}
Reply


Messages In This Thread
Remote function [SOLVED] - by morha12 - 17.05.2014, 06:47
Re: Remote function - by KubiPL - 17.05.2014, 07:53
Re: Remote function - by morha12 - 17.05.2014, 08:08
Re: Remote function - by morha12 - 17.05.2014, 08:51
Re: Remote function - by morha12 - 17.05.2014, 09:14
Re: Remote function - by Threshold - 17.05.2014, 09:31
Re: Remote function - by morha12 - 17.05.2014, 09:46
Re: Remote function - by Threshold - 17.05.2014, 09:49
Re: Remote function - by morha12 - 17.05.2014, 09:53
Re: Remote function - by Pottus - 17.05.2014, 13:11

Forum Jump:


Users browsing this thread: 2 Guest(s)