C4 Problem
#1

I Made This C4 System And Im Have Some Problem When The Player Enter The Car Have Not Explosion !
Im Put In In :
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
new 
vehid = IsPlayerInAnyVehicle(playerid)
    if(
C4Plant[vehid] == 1)
    {
        new 
Float:X,Float:Y,Float:Z;
        
GetObjectPos(C4C,X,Y,Z);
        
CreateExplosion(X,Y,Z, 1, 10.0);
        
DestroyObject(C4C);
        
C4Plant[vehid] = 0;
        } 
And This The Command Make The C4 :
PHP код:
if(strcmp(cmdtext, "/PlantC4", true) == 0)
    {
    new 
vehid = IsPlayerInAnyVehicle(playerid)
    new 
vehicleid = IsPlayerNearAVehicle(playerid,5)
    if(
PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
     if(
C4Plant[vehid] == 0)
        {
          if(
vehicleid == INVALID_VEHICLE_ID)
          return 
SendClientMessage(playerid, COLOR_GREY, "   You aren`t near any vehicle");
          
C4C = CreateObject(1654, 0, 0, 0, 0, 0, 0);
          
AttachObjectToVehicle(C4C, vehicleid, 0.0, 0.0, -0.55, 0, 0, 0);
          
SendClientMessage(playerid, COLOR_RED, "You Are Plant The C4");
          
C4Plant[vehid] = 1;
          }
      }
      return 
1;
} 
What The Problem ?
Reply
#2

Код:
new vehid = IsPlayerInAnyVehicle(playerid)
You don't need this line because the vehicle ID is already specified once you enter the vehicle.
Just use 'vehicleid' instead of 'vehid'.

And by the way, 'IsPlayerInAnyVehicle' doesn't return a vehicle ID, it just returns a true or false.
Reply
#3

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Код:
new vehid = IsPlayerInAnyVehicle(playerid)
You don't need this line because the vehicle ID is already specified once you enter the vehicle.
Just use 'vehicleid' instead of 'vehid'.

And by the way, 'IsPlayerInAnyVehicle' doesn't return a vehicle ID, it just returns a true or false.
But Im Need The Bomb Work Only When The Man Enter To the car but im want, i can do the command only when im near the car, so what I can to do to fix you can show me ?
Reply
#4

Up ++++
Reply
#5

UP+++
Reply


Forum Jump:


Users browsing this thread: