Command doesn't work
#1

These commands doesn't work in my server.
PHP код:
CMD:barrel(playerid//Doesn't create an object
{
    if(
barrel[playerid] == 1)
    {
        new 
Float:x,Float:y,Float:z;
        
GetPlayerPos(playeridxyz);
        
CreateObject(1225,x,y,z0.000.000.00);
        
SendClientMessage(playeridCOLOR_GRAD1"You have planted a barrel. Shoot at it to make it explode.");
    }
    else
    {
        
SendClientMessage(playerid0x33CCFFAA,"You must buy a barrel from the shop!");
    }
    return 
1;
}
CMD:rope(playerid,params[]) //Doesn't create the rope.
{
       if(
rready[playerid] == 0) return SendClientMessage(playerid0x33CCFFAA,"You must buy a rope from the shop!");
       new 
Float:X1Float:Y1Float:Z1,Float:Angle;
       
SetPlayerHealth(playerid2000);
       
rappel[playerid] = 1;
       
rready[playerid] = 0;
       
GetPlayerPos(playeridX1Y1Z1);
       
GetPlayerFacingAngle(playeridAngle);
       
SetPlayerPos(playeridX1Y1Z1+5);
       new 
i=1;while(IsValidObject(i))i++;
       
rope[i] = CreateObject(19089X1Y1Z1+500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1+300Angle);
       
rope[i] = CreateObject(19089X1Y1Z1+100Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-200Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-700Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-900Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-1000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-1200Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-1700Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-2500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-2800Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-3100Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-3400Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-3800Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-4100Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-4500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-4900Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-5100Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-5700Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-6100Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-6500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-6900Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-7300Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-7700Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-8000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-8500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-8900Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-9000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-9500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-8700Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-10000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-10500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-11000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-11500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-12000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-12500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-13000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-13500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-14000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-14500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-15000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-15500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-16000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-16500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-17000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-17500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-18000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-18500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-19000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-19500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-20000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-20500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-21000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-21500Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-22000Angle);
       
rope[i] = CreateObject(19089X1Y1Z1-22500Angle);
       
ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
       return 
1;
CMD:laseron(playerid,params[]) //Works fine
{
    if(
haslaser[playerid] == 1)
    {
        
SetPVarInt(playerid"laser"1);
        
SetPVarInt(playerid"color"GetPVarInt(playerid"color"));
        
SetPlayerAttachedObjectplayerid,91864360.1582490.0102330.1280526.868255351.962524356.884216 );
        
SendClientMessage(playeridCOLOR_GRAD1"You have equipped a laser from your inventory. /laseroff to unequip it. /lasercol to change it's color");
    }
    else
    {
        
SendClientMessage(playerid, -1"*"COL_RED"You don't have a laser in your inventory. Buy one from the shop!");
    }
    return 
1;
}
       
CMD:lasercol(playeridparams[]) //Doesn't change the color
{
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /lasercol [color] (Red, Blue, Pink, Orange, Green, Yellow)");
    if(!
strcmp(params"red"true)) SetPVarInt(playerid"color"19080);
    else if(!
strcmp(params"blue"true)) SetPVarInt(playerid"color"18643),SetPlayerAttachedObjectplayerid,91864360.1582490.0102330.1280526.868255351.962524356.884216 );
    else if(!
strcmp(params"pink"true)) SetPVarInt(playerid"color"19081),SetPlayerAttachedObjectplayerid,91908160.1582490.0102330.1280526.868255351.962524356.884216 );
    else if(!
strcmp(params"orange"true)) SetPVarInt(playerid"color"19082),SetPlayerAttachedObjectplayerid,91908260.1582490.0102330.1280526.868255351.962524356.884216 );
    else if(!
strcmp(params"green"true)) SetPVarInt(playerid"color"19083),SetPlayerAttachedObjectplayerid,91908360.1582490.0102330.1280526.868255351.962524356.884216 );
    else if(!
strcmp(params"yellow"true)) SetPlayerAttachedObjectplayerid,91908460.1582490.0102330.1280526.868255351.962524356.884216 );
    else 
SendClientMessage(playeridCOLOR_GREY"Color not available!");
    return 
1;
}

Reply
#2

PHP код:
CMD:flashlight(playerid,params[])
{
    if(
hasflashlight[playerid] == 0) return SendClientMessage(playerid, -1"*"COL_RED" You don't have a flashlight. Use /shop to buy one.");
    if(
hasflashlight[playerid] == 1)
     {
          if(
isusingflashlight[playerid] == 0)
        {
            if(
IsPlayerAttachedObjectSlotUsed(playerid,3)) RemovePlayerAttachedObject(playerid,3);
            if(
IsPlayerAttachedObjectSlotUsed(playerid,4)) RemovePlayerAttachedObject(playerid,4);
            
SetPlayerAttachedObject(playerid3,1865650.10.038, -0.1, -9018000.030.030.03);
            
SetPlayerAttachedObject(playerid4,1864150.10.02, -0.05000111);
            
SendClientMessage(playerid, -1"*"COL_GREEN" Flashlight sucessfully equipped. Use /flashlight again to turn it off.");
            
isusingflashlight[playerid] = 1;
        }
        else
        {
            if(
IsPlayerAttachedObjectSlotUsed(playerid,3)) RemovePlayerAttachedObject(playerid,3);
            if(
IsPlayerAttachedObjectSlotUsed(playerid,4)) RemovePlayerAttachedObject(playerid,4);
            
isusingflashlight[playerid] = 0;
        }
        
      }
      return 
1;

This as well
Reply
#3

Actually, anything that has to do with objects is not working. Any help?
Reply
#4

This is just to help you working more effective,
Instead of:
PHP код:
if(PlayerInfo[playerid][pAdmin] == 5)
{
// code here
}
else
{
// error code here
}
return 
1
Do this:
PHP код:
if(PlayerInfo[playerid][pAdmin] != 5) return // error code
// Your code here, and vouila done.
return 1
This has further nothing to do with your question, though it's just a tip, take it or leave it.
Reply
#5

When you say it doesn't work what do you mean??
It sends error message? Object is not attached? Success message is sent but object is not attached?? What?
Reply
#6

Unknown command error
Reply
#7

Show me your log
Reply
#8

Yeah, I think it's the plugins or includes.

It had something like this
Код:
[22:44:41]    Error: Function not registered: 'RNPC_AddMovement'
[22:44:41]    Error: Function not registered: 'RNPC_FinishBuild'
[22:44:41]    Error: Function not registered: 'RNPC_CreateBuild'
[22:44:41]    Error: Function not registered: 'RNPC_SetWeaponID'
[22:44:41]    Error: Function not registered: 'RNPC_SetSpecialAction'
[22:44:41]    Error: Function not registered: 'RNPC_SetAngleQuats'
[22:44:41]    Error: Function not registered: 'RNPC_AddPause'
[22:44:41]    Error: Function not registered: 'RNPC_SetUpdateRate'
[22:44:41]    Error: Function not registered: 'MapAndreas_Init'
[22:44:41]    Error: Function not registered: 'RNPC_SetKeys'
Reply
#9

But it doesn't say anything about objects or streamer. Just the RNPC and MapAndreas
Reply
#10

Is gamemode loaded??
Show me full log..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)