4 Errors
#1

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new Killer;
	new Dead;
	new string[128];
	GetPlayerName(killerid, Killer, sizeof Killer);
	GetPlayerName(playerid, Dead, sizeof Dead);
	format(string, sizeof string, "Player %s (ID: %d) killed %s (%d) with a %s", Killer, killerid, Dead, playerid, reason);
	SendClientMessageToAll(0xBB0000AA, string);
    return 1;
}
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(376) : warning 204: symbol is assigned a value that is never used: "playertextid"
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(38 : error 035: argument type mismatch (argument 2)
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(38 : error 035: argument type mismatch (argument 2)
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(389) : error 035: argument type mismatch (argument 2)
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(389) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Learn the correct use of GetPlayerName.
Reply
#3

pawn Код:
new Killer; // <-- Integer! Have to be an array (->String): new Killer[MAX_PLAYER_NAME];
new Dead;
Reply
#4

Fixed code

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new Killer[MAX_PLAYER_NAME], Dead[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,Killer,sizeof(Killer));
    GetPlayerName(playerid, Dead, sizeof (Dead));
    format(string, sizeof string, "Player %s (ID: %d) killed %s (%d) with a %s", Killer, killerid, Dead, playerid, reason);
    SendClientMessageToAll(0xBB0000AA, string);
    return 1;
}
Reply
#5

Quote:
Originally Posted by !Phoenix!
Посмотреть сообщение
pawn Код:
new Killer; // <-- Integer! Have to be an array (->String): new Killer[MAX_PLAYER_NAME];
new Dead;
Quote:
Originally Posted by xir
Посмотреть сообщение
Fixed code

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    new Killer[MAX_PLAYER_NAME], Dead[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,Killer,sizeof(Killer));
    GetPlayerName(playerid, Dead, sizeof (Dead));
    format(string, sizeof string, "Player %s (ID: %d) killed %s (%d) with a %s", Killer, killerid, Dead, playerid, reason);
    SendClientMessageToAll(0xBB0000AA, string);
    return 1;
}
Why you guys are spamming??

Let him Learn something from wiki.

Delux13's gave him the correct example/link
Reply
#6

If he really wants to learn, he can look at his own code and the code i provided and check the link Delux13 gave, then he can compare so he knows what to do in future, no?
Reply
#7

Quote:
Originally Posted by xir
Посмотреть сообщение
If he really wants to learn, he can look at his own code and the code i provided and check the link Delux13 gave, then he can compare so he knows what to do in future, no?
There are errors in the code that you provided ( that you missed )
Reply
#8

Quote:
Originally Posted by Rachael
Посмотреть сообщение
There are errors in the code that you provided ( that you missed )
I can't find any errors, where are you talking about?

Although you should let him figure it out himself. Don't give him plain code to Copy & Paste.
Reply
#9

I expected that he knows how to use it; I think he simply didn't noticed that he declared integers and wanted to call attention to it.
In this case the link wouldn't have helped me.

But I'm not here to argue about that now.
But you're right; some users just have to understand the error messages.

So for you Criss:
-------------------
C:\Users\user\Desktop\Desktop files\SA-MP\gamemodes\AboveFreekBlast.pwn(389) : error 035: argument type mismatch (argument 2)
-------------------
-> "Oh looks like I have used a wrong variable type"
-> Line 389: GetPlayerName(playerid, Dead, sizeof Dead);
-> Argument 2: "Dead"
-> "Where is it declared?" -> new Dead; -> "It's an integer"
-> Wiki -> GetPlayerName() -> argument 2 -> "A string is expected"
--> "Ah there we are"

Better like this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)