SA-MP Forums Archive
OnPlayerClickPlayer problem - 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: OnPlayerClickPlayer problem (/showthread.php?tid=164080)



OnPlayerClickPlayer problem - mihaitza55 - 29.07.2010

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new coordsstring[256];
    new name[MAX_PLAYER_NAME];
    new clickedplayeridname[MAX_PLAYER_NAME];
    GetPlayerName(clickedplayerid, clickedplayeridname, sizeof(clickedplayeridname));
    GetPlayerName(playerid, name, sizeof(name));
    new levelplayer = PlayerInfo[clickedplayerid][pLevel];
    new ageplayer = PlayerInfo[clickedplayerid][pAge];
    new numberplayer = PlayerInfo[clickedplayerid][pPnumber];
    new moneyplayer = PlayerInfo[clickedplayerid][pCash];
    new pointsplayer = PlayerInfo[clickedplayerid][pPoints];
    format(coordsstring, sizeof(coordsstring), "---[Status - %s]---", clickedplayeridname);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Level  - %s", levelplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Age - %s", ageplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Phone Number  - %s", numberplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Cash - %s", moneyplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Points - %s", pointsplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "%s looked at your status (TAB and double-clicked you) !", name);
    SendClientMessage(clickedplayerid, COLOR_GREEN, coordsstring);
    return 1;
}
Damn, there`s my code, looks cool, right ?
Well, here`s what i get ingame what am i doing wrong ??

http://img.b-zone.ro/images/67088922544654046590.png

P.S.: MihaiTZa55 is my name ingame

(it`s in Romanian ingame, i translated the code here so u can understand)


Re: OnPlayerClickPlayer problem - WillyP - 29.07.2010

whats the mihai thing


Re: OnPlayerClickPlayer problem - mihaitza55 - 29.07.2010

mihaitza55 = my name ingame..
i dont understand what`s with the oO`s ingame


Re: OnPlayerClickPlayer problem - Toni - 29.07.2010

Use different string thingy mer bobbers that i have no clue what they are called:

%s = Format a string
%d = Format a whole Intenger
%i = Format a single Intenger
%f = Format a format...and so on.

I'm guessing your age thing should be a number, so try changing %s to %i under the format of age.


Re: OnPlayerClickPlayer problem - -Rebel Son- - 30.07.2010

Try adding more then one thing per line, like add two or three items to one line. Makes it save room!

and yes, toni is right, your using incorrect formats. you got them as "%s", try "%d" or "%i"


Re: OnPlayerClickPlayer problem - [L3th4l] - 30.07.2010

%d - digit : 1 2 3 4
%i - integer : I think same as digit
%f - float : 0.0
%s - string : hi hello


Re: OnPlayerClickPlayer problem - Mike Garber - 30.07.2010

pawn Код:
format(coordsstring, sizeof(coordsstring), "Level  - %d", levelplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Age - %d", ageplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Phone Number  - %d", numberplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Cash - %d", moneyplayer);
    SendClientMessage(playerid, COLOR_GREEN, coordsstring);
    format(coordsstring, sizeof(coordsstring), "Points - %d", pointsplayer);



Re: OnPlayerClickPlayer problem - Hiddos - 30.07.2010

Quote:
Originally Posted by The Toni
Посмотреть сообщение
Use different string thingy mer bobbers that i have no clue what they are called:

%s = Format a string
%d = Format a whole Intenger
%i = Format a single Intenger
%f = Format a format...and so on.

I'm guessing your age thing should be a number, so try changing %s to %i under the format of age.
"%f formats a float, not a format ^^

Case you'd like to know more:
https://sampwiki.blast.hk/wiki/Format


Re: OnPlayerClickPlayer problem - Toni - 30.07.2010

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
"%f formats a float, not a format ^^

Case you'd like to know more:
https://sampwiki.blast.hk/wiki/Format
Lika thank youuuuuuuuuuuuuuuuuuuuuuu


Re: OnPlayerClickPlayer problem - CoaPsyFactor - 30.07.2010

Quote:
Originally Posted by The Toni
Посмотреть сообщение
Use different string thingy mer bobbers that i have no clue what they are called:

%s = Format a string
%d = Format a whole Intenger
%i = Format a single Intenger
%f = Format a format...and so on.

I'm guessing your age thing should be a number, so try changing %s to %i under the format of age.
%f does not format a format, it format float