GameText String - 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: GameText String (
/showthread.php?tid=351078)
GameText String -
Gooday - 14.06.2012
I would like to make a GameText with a string that says "NAME SURNAME" but how do i put the string into a gametext?
A cmd: /myname> Gametext with Name and Surname
Re: GameText String -
Jonny5 - 14.06.2012
surely this will tell you
https://sampwiki.blast.hk/wiki/GameTextForPlayer
just
format the string like shown in that example.
Re: GameText String -
Djole1337 - 14.06.2012
ok lol....
Код:
CMD:myname(playerid,params[])
{
#pragma unused params
new Playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,Playername,sizeof(Playername));
SendClientMessage(playerid,-1,Playername);
return 1;
}
Код:
CMD:myname(playerid,params[])
{
#pragma unused params
new Playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,Playername,sizeof(Playername));
GameTextForPlayer(playerid,-1,Playername, 3000, 3);
return 1;
}
Re: GameText String -
FalconX - 14.06.2012
Quote:
Originally Posted by Mr_DjolE
ok lol....
Код:
CMD:myname(playerid,params[])
{
#pragma unused params
new Playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,Playername,sizeof(Playername));
SendClientMessage(playerid,-1,Playername);
return 1;
}
|
My dear, what makes you put "
#pragma unused params" in ZCMD command? I mean is it necessary to put this in ZCMD command? NO!
ZCMD never returns a warning if params are not used. DCMD needs "#pragma unused params" if the params are not used. It is NOT REALLY necessary to put this in ZCMD. Also, your command only sends a client message on chat. He needs GAMETEXT so following is how we can actually show the player name.
pawn Код:
CMD:myname( playerid, params[ ] )
{
new bPname[ MAX_PLAYER_NAME ]; //declaring a new variable in which we will store the player's name
GetPlayerName( playerid, bPname, sizeof( bPname ) ); // getting the name and storing in the bPname variable
GameTextForPlayer( playerid, bPname, 3000, 1 ); // 3000 is ms and can be changed. 1 is a style and you can see the styles in the following site
return 1;
}
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Hope this helps.
Regards,
FalconX