Problem with array
#1

Код:
UccisioniGDM[issuerid] += amount;
	new string[256];
	format(string,sizeof(string),"Danno fatto: %0.f", UccisioniGDM[issuerid]);
	SendClientMessage(issuerid,Lightblue,string);

	if(UccisioniGDM[issuerid] >= 1500.0)
	{
	new nameDM[MAX_PLAYER_NAME];
	new stringDM[256];
	GetPlayerName(issuerid,nameDM,128);
	format(stringDM,sizeof(stringDM),"Il vincitore dell'Evento DM e' %s, ha guadagnato 1 Punto Esperienza e 15000$!",nameDM);

	GivePlayerMoney(issuerid,15000);
	PlayerInfo[issuerid][pExp]++;
	if(PlayerInfo[issuerid][pExp] >= 20)
	{
	LevelUp(issuerid);
	}
	SendClientMessageToAll(Gold,stringDM);
I put this in "OnPlayerTakeDamage" and i have create an if with if UccisioniGDM[issuerid] > 1500.0 it finishes the event
but if i get shot once it finishes :/ can't understand what's wrong in this code..

UccisioniGDM[issuerid] is the array that stores the damage done in the DM Event
Reply
#2

1. UccisioniGDM must be a Float
2. You need reset array when event start UccisioniGDM[ id ] = 0.0;
3. issuerid must be != INVALID_PLAYER_ID
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
1. UccisioniGDM must be a Float
2. You need reset array when event start UccisioniGDM[ id ] = 0.0;
3. issuerid must be != INVALID_PLAYER_ID
How can i switch UccisioniGDM to a float? A float that is bound to issuerid
Reply
#4

on top must be
pawn Код:
new Float:UccisioniGDM[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)