11.02.2018, 10:03
A little question
11.02.2018, 10:08
it's an object ID 1240 which is attached to a player.
well I have a cooldown between posts and I'll make an example
well I have a cooldown between posts and I'll make an example

PHP код:
OnPlayerTakeDamage/OnPlayerGiveDamage
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
new obj = CreateObject(1240,X,Y,Z+1.5,0,0,0);
AttachObjectToPlayer(obj,playerid,0,0,1.5,0,0,0);
SetTimerEx("DestroyThisAttachedObject",1000,0,"i",obj);
forward DestroyThisAttachedObject(obj);
public DestroyThisAttachedObject(obj)
{
DestroyObject(obj);
return 1;
}
11.02.2018, 10:28
Works good, but if I fall or get hit I can see that above my head, It's pretty bothersome how can I disable so I can't view it but other people can?
11.02.2018, 10:39
11.02.2018, 10:54
actually you can create a PlayerObject for all of these players, exept him.
it's pretty simple.
P.S. @Fratello, everything is possible if scripter wants.
it's pretty simple.
PHP код:
OnPlayerTakeDamage/OnPlayerGiveDamage
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(i != playerid)
{
new obj[i] = CreatePlayerObject(i,1240,X,Y,Z+1.5,0,0,0);
AttachPlayerObjectToPlayer(i,obj[i],playerid,0,0,1.5,0,0,0);
SetTimerEx("DestroyThisAttachedObject",1000,0,"ii",i,obj[i]);
}
}
forward DestroyThisAttachedObject(playerid,obj);
public DestroyThisAttachedObject(playerid,obj)
{
DestroyPlayerObject(playerid,obj);
return 1;
}
11.02.2018, 10:58
You mean if I hit a player, only he will have it and not me? or you mean everyone will have it?
"for all of these players, exept him."
"for all of these players, exept him."
11.02.2018, 11:01
when you hit a player, he'll get this icon, which will be visible for everyone but not for him.
it's what u asked for yeah?
it's what u asked for yeah?
11.02.2018, 11:13
Код:
AttachPlayerObjectToPlayer(i,heartobject[i], playerid, 0,0,1.5,0,0,0);
Код:
C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(1893) : error 028: invalid subscript (not an array or too many subscripts): "heartobject" C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(1893) : warning 215: expression has no effect C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(1893) : error 001: expected token: ";", but found "]" C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(1893) : error 029: invalid expression, assumed zero C:\Users\yan\Desktop\LS DM\gamemodes\DBv1.pwn(1893) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Код:
new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x,y,z); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++) { new heartobject = CreateObject(i,1240, x,y,z+1.5,0,0,0); AttachPlayerObjectToPlayer(i,heartobject[i], playerid, 0,0,1.5,0,0,0); SetTimerEx("HeartObject", 3000,0,"ii", i, heartobject[i]); } return 1; } forward HeartObject(playerid,heartobject); public HeartObject(playerid,heartobject) { DestroyPlayerObject(heartobject); return 1; }
11.02.2018, 11:15
this code is right > AttachPlayerObjectToPlayer(i,heartobject[i], playerid, 0,0,1.5,0,0,0);
u're using heartobject = CreatePlayer... or heartobject[i] = CreatePlayerObj... ?
u must add here a playerid > DestroyPlayerObject(playerid,heartobject);
u're using heartobject = CreatePlayer... or heartobject[i] = CreatePlayerObj... ?
u must add here a playerid > DestroyPlayerObject(playerid,heartobject);
11.02.2018, 11:15
Why are you accessing it like that? It obviously is not an array. Remove the [i], it's a normal variable.
That's wrong as well, you can't initialize an array with a variable as it's size, since the arrays are initialized on compilation time instead of run time.
That's wrong as well, you can't initialize an array with a variable as it's size, since the arrays are initialized on compilation time instead of run time.
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)