"Drop" object
#1

Code:
CMD:drop(playerid, params[])
{
if(!IsValidDynamicObject(Drop[playerid]) && !IsValidDynamicObject(Drop2[playerid]))
   {
   SendClientMessage(playerid, WHITE, "1");
   GetPlayerPos(playerid, dropcord[0], dropcord[1], dropcord[2]);
   Drop[playerid] = CreateDynamicObject(2025, dropcord[0], dropcord[1], dropcord[2]-0.9, 0, 0, 0.00);
   Droplabel[playerid] = CreateDynamic3DTextLabel("Drop 1", 0xFFFFFFAA,dropcord[0], dropcord[1], dropcord[2]-0.9, 2.5);
   }

   if(IsValidDynamicObject(Drop[playerid]) && !IsValidDynamicObject(Drop2[playerid]))
   { //// 2
   SendClientMessage(playerid, WHITE, "2");
   GetPlayerPos(playerid, dropcord[0], dropcord[1], dropcord[2]);
   Drop2[playerid] = CreateDynamicObject(2025, dropcord[0], dropcord[1], dropcord[2]-0.9, 0, 0, 0.00);
   Droplabel2[playerid] = CreateDynamic3DTextLabel("Drop 2", 0xFFFFFFAA,dropcord[0], dropcord[1], dropcord[2]-0.9, 2.5); 
   }
   

return 1;
}
https://www.youtube.com/watch?v=10FP...ature=*********

Why the f it create me 2 objects (as you can see i get message "1" and "2"?
I want to make it like this:
If object "Drop" didn't exist - create object "Drop"
If object "Drop" exist - create object "Drop2"
Reply


Messages In This Thread
IsValidDynamicObject problem - by Supermaxultraswag - 17.02.2015, 14:05
Re: "Drop" object - by Threshold - 17.02.2015, 14:36
Re: "Drop" object - by Supermaxultraswag - 17.02.2015, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)