OnPlayerEnterArea(playerid,areaid) {
#1

Код:
OnPlayerEnterArea(playerid,areaid) {
if (areaid==AREA_aa) SendClientMessage(playerid, COLOR_YELLOW, "This Is A Safe Zone! No Killing!");
printf("OnPlayerEnterArea(%d,%d)",playerid,areaid);
new vehicleid = GetPlayerVehicleID(playerid);
if (GetVehicleModel(vehicleid) == 520||GetVehicleModel(vehicleid) == 432 ||GetVehicleModel(vehicleid) == 469)
{ 
SetVehiclePos(GetPlayerVehicleID(playerid),1556.455,-1233.639,500.770);
SetPlayerInterior(playerid, 0);
}
else
{
ResetPlayerWeapons(playerid);

}
}
But If I Try To Make A New Area Under That I Get

Код:
error 010: invalid function or declaration
Reply
#2

hey seif!

OnPlayerEnterArea(playerid,areaid) {
if (areaid==AREA_aa) SendClientMessage(playerid, COLOR_YELLOW, "This Is A Safe Zone! No Killing!");
printf("OnPlayerEnterArea(%d,%d)",playerid,areaid) ;
new vehicleid = GetPlayerVehicleID(playerid);
if (GetVehicleModel(vehicleid) == 520||GetVehicleModel(vehicleid) == 432 ||GetVehicleModel(vehicleid) == 469)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1556.45 5,-1233.639,500.770);
SetPlayerInterior(playerid, 0);
}
else
{
ResetPlayerWeapons(playerid);

}
}
if (areaid==AREA_sg) SendClientMessage(playerid, COLOR_YELLOW, "Welcome To The ShotGun Deathmatch!");
printf("OnPlayerEnterArea(%d,%d)",playerid,areaid) ;
GivePlayerWeapon(blablabla)
}

Theres what i added!

Код:
if (areaid==AREA_sg) SendClientMessage(playerid, COLOR_YELLOW, "Welcome To The ShotGun Deathmatch!");
Gives The Error!
Reply
#3

Try This

pawn Код:
OnPlayerEnterArea(playerid,areaid)
{
new vehicleid = GetPlayerVehicleID(playerid);

    if (areaid==AREA_aa)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "This Is A Safe Zone! No Killing!");
        printf("OnPlayerEnterArea(%d,%d)",playerid,areaid);

           
            if (GetVehicleModel(vehicleid) == 520||GetVehicleModel(vehicleid) == 432 ||GetVehicleModel(vehicleid) == 469)
            {
            SetVehiclePos(vehicleid,1556.455,-1233.639,500.770);
            SetPlayerInterior(playerid, 0);
            }
    }
    if (areaid==AREA_sg)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "Welcome To The ShotGun Deathmatch!");
    printf("OnPlayerEnterArea(%d,%d)",playerid,areaid);
    GivePlayerWeapon(blablabla)
    }
    else
    {
    ResetPlayerWeapons(playerid);
    }


}
You Were Missing A Few Brackets, the "ELSE" has to go at the end and you get the vehicleid 2 times :P

Note I didn't Compile because I don't have "OnPlayerEnterArea"
Reply
#4

Lol thanks but i posted this over a year ago and know how to script now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)