OnPlayerClickPlayer problem
#1

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)
Reply
#2

whats the mihai thing
Reply
#3

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

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.
Reply
#5

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"
Reply
#6

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

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);
Reply
#8

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
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)