dogtags
#1

Hello there, I am creating a Kill Confirmed gamemode for myself and a couple of friends and I'm wondering, when I die, I want to have some sort of "Tag" that needs picking up.

Hello there,
Well i am creating a gamemode which basically when player dies a player pickup is created if other team picked it up +1 point but if other team picked it up it's denied well i can't really think how it can be done and picked under onplayerpickuppickup

BUT, when I come to use pickups, I can't think how I would make it pickable under OnPlayerPickupPickup.

Like example i could have CreatePickup under OnPlayerDeath but on picking it up i couldn't tjhink how to get this working good
if someone could help me out ++rep for them and will be appreciated

I also need it to check if the player's team (who picked it)

new KCPickup;
new KCPickup2;


OnPlayerDeath
if player's is buster and killer is zombie so createpickup is called
and vice versa in kcpickup2
Код:
if(pickupid == KCPickup) 
	{
		if(PlayerInfo[playerid][IsPlaying] == true)
		{
			if(PlayerInfo[playerid][gTeam] == ZOMBIE) 
			{ 
				TeamKCKills[PlayerInfo[playerid][gTeam]]+=PointCount;
				SendClientMessage(playerid, -1, "{FFFFFF}KILL:{57BB82}Kill confirmed"); 
			}
			else if(PlayerInfo[playerid][Team] == BUSTER)
			{
				new string[256]; 
                                TeamKCDenie[PlayerInfo[playerid][gTeam]]+=PointCounter;
				format(string,sizeof(string),"{FFFFFF}DEATH:{57BB82}Death has been denied");
				SendClientMessage(playerid, -1, string); 
			}
		}
	}
	if(pickupid == KCPickup2) 
	{
		if(PlayerInfo[playerid][IsPlaying] == true)
		{
			if(PlayerInfo[playerid][gTeam] == BUSTER) 
			{ 
				TeamKCKills[Player[playerid][gTeam]]+=PointCount;
				SendClientMessage(playerid, -1, "{FFFFFF}KILL:{57BB82}Kill confirmed"); 
			}
			else if(PlayerInfo[playerid][gTeam] == ZOMBIE)
			{
				new string[256];
                                TeamKCDenie[PlayerInfo[playerid][gTeam]]+=PointCounter;
				format(string,sizeof(string),"{FFFFFF}DEATH:{57BB82}Death has been denied");
				SendClientMessage(playerid, -1, string); 
			}
		}
	}
Any help is appreciated
Reply
#2

Where you've made a single variable, you need an array.

Because each player can drop a dogtag, then you need to have one, per player... Even 2 if you think that it won't be picked up before the player dies a second time.

Also, you don't want people picking up their own dogtag.



You check the players team against the dogtag and ensure the teams don't match, but you still want to ensure you find the right dogtag, instead of checking 2 different variables one for each team. (In that scenario you could only ever have 2 dogtags out, 1 for each possible player, where you could have way more.)
Reply
#3

Something like that should work or i guess i have to create a variable to check if player died or not to get it picked up
Код:
foreach(new i :Player)
	{
		if(IsPlayerConnected(i))
		{
			if(pickupid == KCPickup[i]) 
			{
				if(KCPickup[i] != KCPickup[playerid])
				{
					if(PlayerInfo[i][gTeam] != PlayerInfo[playerid][gTeam]) 
					{ 
						TeamKCKills[PlayerInfo[playerid][gTeam]]+=PointCount;
						SendClientMessage(playerid, -1, "{FFFFFF}KILL:{57BB82}Kill confirmed"); 
					}
					else 
					{
						TeamKCDenie[PlayerInfo[playerid][gTeam]]+=PointCount;
						SendClientMessage(playerid, -1,"{FFFFFF}DEATH:{57BB82}Death has been denied"); 
					}
				}
			} else return SendClientMessage(playerid, -1, "{FFFFFF}DEATH:{57BB82}You have denied your own death");
		}
	}
Reply
#4

I'm pretty sure foreach doesn't need to check if they are connected in your usage. (Even though it won't hurt).



But yes, that looks right to be of some development for you.
Reply
#5

Well I have tried it after but the fact is when i pickup the pickup created after i kill the enemy it doesn't count and enemy is able to re pick it up after i picked it

Could you show me an example code
Reply
#6

Then that callback, doesn't destroy the pickup automatically, you need to do this.

Код:
DestroyPickup(KCPickup[i]);
on the various endings in that callback that need it removed.
Reply
#7

Well i have already added the destroypickup thing but now this happens idk what's wrong
https://ibb.co/gZyQ5z
Reply
#8

Just check you've put the destroy where this is, not anywhere else. Just after the messages saying they've been picked up, you should put them in there.

PHP код:
                    if(PlayerInfo[i][gTeam] != PlayerInfo[playerid][gTeam]) 
                    { 
                        
TeamKCKills[PlayerInfo[playerid][gTeam]]+=PointCount;
                        
SendClientMessage(playerid, -1"{FFFFFF}KILL:{57BB82}Kill confirmed");  //destroy pickup after this line
                    
}
                    else 
                    {
                        
TeamKCDenie[PlayerInfo[playerid][gTeam]]+=PointCount;
                        
SendClientMessage(playerid, -1,"{FFFFFF}DEATH:{57BB82}Death has been denied"); //destroy pickup after this line
                    

Being that it's going through the if, and the else if, there's likely a problem elsewhere, something to do with your team assignment or checks.

Is gTeam actually working correctly?

Could make a command to check your team, and put it out to the client.
Reply
#9

Yeah i have exactly put the destroy thing where it should be put and also the gteam variable is working correctly i have many other things that is done with the variable
Reply
#10

Check Private message
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)