Ayuda con estos warning
#1

Hola

Tengo 2 warnings al recopilar mi GM son estos

pwn( 1808 ) : warning 209: function "OnPlayerSpawn" should return a value
pwn( 1816 ) : warning 217: loose indentation

y en esas lineas tengo esto:

Linea 1807: return 1;
Linea 1808: }

public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID){
SendDeathMessage(killerid,playerid,reason);
Linea 1816: if(gTeam[killerid] != gTeam[playerid]){
GivePlayerMoney(killerid, 300);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}else{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
GivePlayerMoney(killerid, -300);
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
}
}

return 1;
}


que esta dandome el warning? ayudenme

saludos....
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        SendDeathMessage(killerid,playerid,reason);
        if(gTeam[killerid] != gTeam[playerid])
        {
            GivePlayerMoney(killerid, 300);
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        }
        else
        {
            SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
            GivePlayerMoney(killerid, -300);
            SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
        }
    }
    return 1;
}
Reply
#3

Prueba asi:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   if(killerid != INVALID_PLAYER_ID)
   {
   SendDeathMessage(killerid,playerid,reason);
   }
   if(gTeam[killerid] != gTeam[playerid])
   {
   GivePlayerMoney(killerid, 300);
   SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
   }else{
   SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
   GivePlayerMoney(killerid, -300);
   SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
   }
   }
   return 1;
}
Reply
#4

Hola dis77urbio si lo pongo como me dices me suelta este error


public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
SendDeathMessage(killerid,playerid,reason);
}
if(gTeam[killerid] != gTeam[playerid])
{
GivePlayerMoney(killerid, 300);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
else
{
SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
GivePlayerMoney(killerid, -300);
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
}
}
return 1; pwn(1830) : error 010: invalid function or declaration
}
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) {
        SendDeathMessage(killerid,playerid,reason);
        if(gTeam[killerid] != gTeam[playerid]) {
            GivePlayerMoney(killerid, 300);
            SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        }
        else {
            SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
            GivePlayerMoney(killerid, -300);
            SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)