SA-MP Forums Archive
Few Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Few Errors (/showthread.php?tid=265149)



Few Errors - Mr.Black - 29.06.2011

[QUOTE]Look at this :
Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
// Add 1 to this killer's score.
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
return 1;
}
{
GameTextForPlayer(playerid,"~r~Wasted",3000,2);
return 1;
}

And this Happen when i Complie It :


Quote:

E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(52) : warning 202: number of arguments does not match definition
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(53) : warning 202: number of arguments does not match definition
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(54) : warning 202: number of arguments does not match definition
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(93) : error 055: start of function body without function header
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(95) : error 010: invalid function or declaration
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(135) : warning 217: loose indentation
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(140) : warning 217: loose indentation
E:\LOSSAN~1\GAMEMO~1\LSGW2.pwn(145) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Any ways to fix this ?


Re: Few Errors - *IsBack - 29.06.2011

The code you posted is missing { before SetPlayerScore
And what's this about:
pawn Код:
return 1;
}
{
That's not valid


Re: Few Errors - Sasino97 - 29.06.2011

Quote:
Originally Posted by Mr.Black
Посмотреть сообщение
Look at this :


And this Happen when i Complie It :





Any ways to fix this ?
•.• Are you joking?


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
// Add 1 to this killer's score.
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
return 1; // wtf is that
} // *
{ // *
GameTextForPlayer(playerid,"~r~Wasted",3000,2);
return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    // Add 1 to this killer's score.
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    GameTextForPlayer(playerid,"~r~Wasted",3000,2);
    return 1;
}
Pawn syntax is

Код:
FunctionName(Args)
{
    Function1;
    Function2;
    Function3;
    return;
}
NOT

Код:
FunctionName(Args)
{
    Function1;
    return;
}
{
    Function2;
    return;
}
{
    Function3;
    return;
}



Re: Few Errors - Mr.Black - 29.06.2011

Thanks; D