CreateDynamicObjectEx constant experssion?
#1

I want to make objects that are visible only for one player with incognitos streamer.
As CreateDynamicObjectEx should look like this:
Код:
native CreateDynamicObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players);
I did it this way:
pawn Код:
CreateDynamicObjectEx(1454, -209.0760,-33.3091,3.0828, 0, 0, 0, 0, 200, {0},{ 0 }, {playerid});
Error that I am getting:
Код:
error 008: must be a constant expression; assumed zero
As constant, I think it is aiming at '{playerid}' (when I put any constant on place of it it's fine). The only solution of this problem that I see is:
pawn Код:
switch(playerid)
{
    case 0:CreateDynamicObjectEx(1454, -209.0760,-33.3091,3.0828, 0, 0, 0, 0, 200, {0},{ 0 }, {0});
    case 1:CreateDynamicObjectEx(1454, -209.0760,-33.3091,3.0828, 0, 0, 0, 0, 200, {0},{ 0 }, {1});
    case 2:CreateDynamicObjectEx(1454, -209.0760,-33.3091,3.0828, 0, 0, 0, 0, 200, {0},{ 0 }, {2});
//...
    case 499:CreateDynamicObjectEx(1454, -209.0760,-33.3091,3.0828, 0, 0, 0, 0, 200, {0},{ 0 }, {499});
}
But it looks crazy. Is there a better solution, and why does it need to be a constant anyway?
Thank you in advance.
Reply


Messages In This Thread
CreateDynamicObjectEx constant experssion? - by Roko_foko - 03.09.2012, 07:06
Re: CreateDynamicObjectEx constant experssion? - by Misiur - 03.09.2012, 07:31
Re: CreateDynamicObjectEx constant experssion? - by Roko_foko - 03.09.2012, 08:14
Re: CreateDynamicObjectEx constant experssion? - by Misiur - 03.09.2012, 09:12
Re: CreateDynamicObjectEx constant experssion? - by Roko_foko - 03.09.2012, 09:19
Re: CreateDynamicObjectEx constant experssion? - by Misiur - 03.09.2012, 09:22
Re: CreateDynamicObjectEx constant experssion? - by Roko_foko - 03.09.2012, 09:25

Forum Jump:


Users browsing this thread: 1 Guest(s)