Param's to destroy object
#1

pawn Код:
forward destruirobj2( { Float , _ } : ... );
public destruirobj2( { Float , _ } : ... ) {
    new c = numargs ( ) , idx;
    for ( new i = 0; i < c; i ++ ) {
        new Arg[ 32 ] ;
        while ( getarg ( i , idx ) ) {
            Arg[ idx ] = getarg ( i , idx );
            idx ++;
        }
        format ( Arg , 32 , "%d" , Arg );
        printf("%d",Arg);
        idx = 0;
        DestroyObject(strval(Arg));
    }
    return 1;
}
command

pawn Код:
if(!strcmp("/2mira",cmdtext,true))
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    new obj=CreateObject(19314,x,y+1,z,0,0,0,250);
    new obj2=CreateObject(19314,x,y-1,z,0,0,0,250);
    printf("%d,%d",obj,obj2);
    SetTimerEx("destruirobj2",3000,false,"dd",obj,obj2);
    return 1;
}
in console

Код:
[21:44:05] 264,265
[21:44:09] 49
[21:44:09] 49
when i write /2mira create the objects with id's 264 and 265 but after, don't read this numbers, why? timer problem?
Reply
#2

Why do you have timers for a simple createobject? I may be reading this wrong, but createobject and deleteobjects font need params or none of that shit
Reply
#3

try to avoid optional params
Reply
#4

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
Why do you have timers for a simple createobject? I may be reading this wrong, but createobject and deleteobjects font need params or none of that shit
is not to create but to destuir! I create several objects at a time and want to delete them all after a moment
but have got otherwise! forget! thank you

Quote:
Originally Posted by BigETI
Посмотреть сообщение
try to avoid optional params
can you give me an example please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)