[Problem] CreateObjectCommand
#1

Hellow Guys.
I try to do a command with a object. Hmmm, let me to explain. When i type a command to create a object at my pos.
I try to do that:
But the object aren't create.

Код HTML:
CMD:plantbomb(playerid, params[])
{
 if(IsPlayerInRangeOfPoint(playerid, 10.0, -197.0806,2137.8376,-13.9528))
 {
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
     if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "");
  if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_DS, "{999999}Animations are inaccessible on foot.");
     ClearAnimations(playerid);
     OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
     bmb[playerid] = CreateObject(18257, 0.0,0.0,0.0, 0.0,0.0,0.0, 40.0);
     SetObjectPos(bmb[playerid], x, y, z);
     SetTimerEx("BombExplode", 10*1000, false, "i", playerid);
     SCM(playerid, -1, "");
 }
 if(IsPlayerInRangeOfPoint(playerid, 10.0, -216.2014,2099.9409,-13.9028))
 {
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
     if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "");
  if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_DS, "{999999}Animations are inaccessible on foot.");
     ClearAnimations(playerid);
     OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
     bmb[playerid] = CreateObject(18257, x, y, z, x, y, z, 30);
     SetTimerEx("BombExplode", 10*1000, false, "i", playerid);
     SCM(playerid, -1, "");
 }
 if(IsPlayerInRangeOfPoint(playerid, 10.0, -254.7464,2094.7515,-13.9028))
 {
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
     if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "");
  if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_DS, "{999999}Animations are inaccessible on foot.");
     ClearAnimations(playerid);
     OnePlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
     bmb[playerid] = CreateObject(18257, x, y, z, x, y, z, 30);
     SetTimerEx("BombExplode", 10*1000, false, "i", playerid);
     SCM(playerid, -1, "");
 }
 return 1;
}
Reply
#2

What is the bug ?
Object has not created ? You have a message ? Else, are you sure you are in range of point ?
Reply
#3

The object aren't create. I don't know why. Was in Range. Lol
Reply
#4

PHP код:
CMD:plantbomb(playeridparams[])
{
    if(
IsPlayerInRangeOfPoint(playerid10.0, -197.0806,2137.8376,-13.9528))
    {
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"");
        if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_DS"{999999}Animations are inaccessible on foot.");
        
ClearAnimations(playerid);
        
OnePlayAnim(playerid"BOMBER""BOM_Plant"4.000000);
        
bmb[playerid] = CreateObject(182570.0,0.0,0.00.0,0.0,0.040.0);
        
SetObjectPos(bmb[playerid], xyz);
        
SetTimerEx("BombExplode"10*1000false"i"playerid);
        
SCM(playerid, -1"");
        
printf("debug 1");
    }
    if(
IsPlayerInRangeOfPoint(playerid10.0, -216.2014,2099.9409,-13.9028))
    {
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"");
        if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_DS"{999999}Animations are inaccessible on foot.");
        
ClearAnimations(playerid);
        
OnePlayAnim(playerid"BOMBER""BOM_Plant"4.000000);
        
bmb[playerid] = CreateObject(18257xyzxyz30);
        
SetTimerEx("BombExplode"10*1000false"i"playerid);
        
SCM(playerid, -1"");
        
printf("debug 2");
    }
    if(
IsPlayerInRangeOfPoint(playerid10.0, -254.7464,2094.7515,-13.9028))
    {
    
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"");
        if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_DS"{999999}Animations are inaccessible on foot.");
        
ClearAnimations(playerid);
        
OnePlayAnim(playerid"BOMBER""BOM_Plant"4.000000);
        
bmb[playerid] = CreateObject(18257xyzxyz30);
        
SetTimerEx("BombExplode"10*1000false"i"playerid);
        
SCM(playerid, -1"");
        
printf("debug 3");
    }
    
printf("debug 4");
    return 
1;

Give me printf debugs.
Reply
#5

Quote:

Give me printf debugs.

What ? printf debugs ? You type there printf debug.
Reply
#6

1. Connect you to the server.
2. Type "/plantbomb"
3. Give me logs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)