SA-MP Forums Archive
dont work - 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)
+--- Thread: dont work (/showthread.php?tid=458175)



dont work - ScRipTeRi - 15.08.2013

Hello i crate one command /id but when i make it to other player say just my name and when make other player tell just your self how to make it for can see and other player?

pawn Код:
dcmd_id(playerid, params[])
{
    new pid,PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    if(sscanf(params, "u", pid)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /id <part of name>");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid,COLOR_RED, "Player not found.");
    SendClientMessage(playerid, 0xE89B5BBB, "Players found:");
    format(str, sizeof(str), "> %s (ID:%d) ",PlayerName ,pid );
    SendClientMessage(playerid, COLOR_WHITE, str);
    return 1;
}
Thank you.


Re: dont work - ScRipTeRi - 15.08.2013

anyone?


Re: dont work - -Prodigy- - 15.08.2013

1. I don't know what the fuck you just said on your post.
2. Stop bumping your fucking thread


Re: dont work - Sanady - 15.08.2013

pawn Код:
dcmd_id(playerid, params[])
{
    new pid,PlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    if(sscanf(params, "u", pid)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /id <part of name>");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid,COLOR_RED, "Player not found.");
    SendClientMessage(playerid, 0xE89B5BBB, "Players found:");
    format(str, sizeof(str), "> %s (ID:%i) ",PlayerName[pid] ,pid );
    SendClientMessage(playerid, COLOR_WHITE, str);
    return 1;
}
Try this.


Re: dont work - ScRipTeRi - 15.08.2013

Line GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME); error
Код:
error 048: array dimensions do not match



Re: dont work - Sanady - 15.08.2013

Just change PlayerName to PlayerName[playerid]