17.02.2015, 14:05
(
Last edited by Supermaxultraswag; 17/02/2015 at 02:30 PM.
Reason: IsValidDynamicObject problem
)
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; }
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"