[Ajuda] OnPlayerDeath nгo funciona
#1

Olб,
sou novo no forum, e queria saber porque este OnPlayerDeath nгo funciona ....


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     Deathin[killerid]++;
     AtualiseScore(killerid);
     AtualiseScore(playerid);
     return 1;
}

public AtualiseScore(playerid)
{
     new iStrScorep[60];
     format(iStrScorep, sizeof(iStrScorep),"Matou:%d",Deathin[playerid]);
     TextDrawSetString(Deathin[playerid], iStrScorep);
     TextDrawShowForPlayer(playerid, Deathin[playerid]);
     return 1;
}
bigado...
Reply
#2

PHP код:
new Text:Score[MAX_PLAYERS];
forward AtualiseScore(playerid);
public 
OnGameModeInit()
{
    for(new 
0MAX_PLAYERS++)
    {
        
Score[i] = TextDrawCreate(XYDeathin[playerid]);
    }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    
Deathin[killerid]++;
    
AtualiseScore(killerid);
    
AtualiseScore(playerid);
    return 
1;
}
public 
AtualiseScore(playerid)
{
    new 
iStrScorep[10];
    
format(iStrScorepsizeof(iStrScorep),"Matou:%d",Deathin[playerid]);
    
TextDrawSetString(Score[playerid], iStrScorep);
    
TextDrawShowForPlayer(playeridScore[playerid]);
    return 
1;

Reply
#3

seu cуdigo estб exatamente igual ao meu...
Reply
#4

Nгo, definitivamente nгo estб igual ao seu ...
Reply
#5

PHP код:
new 
   
TextkScoreMAX_PLAYERS ],
   
NomeMAX_PLAYER_NAME ],
   
MorreuMAX_PLAYERS ],
   
MatouMAX_PLAYERS ],
   
ScoreMAX_PLAYERS ],
   
sStr128 ];
public 
OnPlayerConnectplayerid )
{
   
kScoreplayerid ] = TextDrawCreate( ... );
   
//Coloque aqui o resto das paradas
   
return true;
}
public 
OnPlayerSpawnplayerid )
{
   
Scoreplayerid ] = Matouplayerid ];
   
Scoreplayerid ] -= Morreuplayerid ];
   
formatsStrsizeofsStr ), "Score: %d"Scoreplayerid ] );
   
TextDrawSetStringkScoreplayerid ], sStr );
   
TextDrawShowForPlayerplayeridkScoreplayerid ] );
   return 
true;
}
public 
OnPlayerDeathplayeridkilleridreason )
{
   
Matoukillerid ] ++;
   
Morreuplayerid ] ++;
   
Scorekillerid ] = Matoukillerid ];
   
Scorekillerid ] -= Morreukillerid ];
   
Scoreplayerid ] = Matouplayerid ];
   
Socreplayerid ] -= Morreuplayerid ];
   
formatsStrsizeofsStr ), "Score: %d"Scorekillerid ] );
   
TextDrawSetStringkScorekillerid ], sStr );
   
TextDrawShowForPlayerkilleridkScorekillerid ] );
   
formatsStrsizeofsStr ), "Score: %d"Scoreplayerid ] );
   
TextDrawSetStringkScoreplayerid ], sStr );
   
TextDrawShowForPlayerkilleridkScoreplayerid ] );
   
SetPlayerScoreplayeridScoreplayerid ] );
   
SetPlayerScorekilleridScorekillerid ] );
   return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)