Param's to destroy object - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Param's to destroy object (
/showthread.php?tid=432891)
Param's to destroy object -
DartakousLien - 24.04.2013
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?
Re: Param's to destroy object -
Mattakil - 24.04.2013
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
AW: Param's to destroy object -
BigETI - 24.04.2013
try to avoid optional params
Respuesta: Re: Param's to destroy object -
DartakousLien - 24.04.2013
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 ?