#1

i need help
so: i want do all huntleys can be drived just by admin [rcon] a
and Mafia Boss Skin can be used just by admin [rcon]
when i logged in rcon all cars will not take damage for me
Reply
#2

pawn Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(vehicleid == 579)
        {
            if(!IsPlayerAdmin(playerid)
            {
                  SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
                  ClearAnimations(playerid);
                  return 1;
             }
        }
    }
}
Reply
#3

all cars drived by admins [rcon] will have infinty health 1000 everytime i want say
and mafia boss just for admin
mafia boss skin
Reply
#4

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
pawn Код:
OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(vehicleid == 579)
        {
            if(!IsPlayerAdmin(playerid)
            {
                  SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
                  ClearAnimations(playerid);
                  return 1;
             }
        }
    }
}
You forget the else with RemovePlayerFromVehicle.
Reply
#5

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
You forget the else with RemovePlayerFromVehicle.
RemovePlayerFromVehicle wouldn't work in this callback, as this is called right away when player presses enter near a vehicle (at least it used to be called then), so you have to clear the entering animation, and the player can't enter.
Reply
#6

i get errors
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger)
    {
        if(vehicleid == 579)
        {
            if(!IsPlayerAdmin(playerid)
            {
                  SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
                  ClearAnimations(playerid);
                  return 1;
            }
        }
   }
}
pawn Код:
C:\Users\Vio\Desktop\nothing.pwn(106) : error 001: expected token: ")", but found "{"
C:\Users\Vio\Desktop\nothing.pwn(113) : warning 209: function "OnPlayerEnterVehicle" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(ispassenger == 0)
    {
        if(vehicleid == 579)
        {
            if(!IsPlayerAdmin(playerid)
            {
                  SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
                  ClearAnimations(playerid);
            }
        }
   }
   return 1;
}
Reply
#8

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(!ispassenger == 0)
    {
        if(vehicleid == 579)
        {
            if(!IsPlayerAdmin(playerid)
            {
                  SendClientMessage(playerid, -1, "Huntley can be driven only by admin.");
                  ClearAnimations(playerid);
            }
        }
    }
    return 1;
}
pawn Код:
C:\Users\Vio\Desktop\nothing.pwn(101) : warning 213: tag mismatch
C:\Users\Vio\Desktop\nothing.pwn(106) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
RemovePlayerFromVehicle wouldn't work in this callback, as this is called right away when player presses enter near a vehicle (at least it used to be called then), so you have to clear the entering animation, and the player can't enter.
Then you can better use OnPlayerKeyStateChange
Reply
#10

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Then you can better use OnPlayerKeyStateChange
Yes, but I don't know how to actually use that (I'm not pretty good in that area), so I dislike using it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)