SA-MP Forums Archive
Help with Format/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: Help with Format/String (/showthread.php?tid=287995)



Help with Format/String - ServerScripter - 05.10.2011

Hi , i create this One (to punish players who disconnect if they are Cuffed):
PHP код:
public OnPlayerDisconnect(playeridreason)
{
if(
PlayerCuffed[playerid] == 2)
{
SafeGivePlayerMoney(playerid, -4500);
PlayerInfo[playerid][pJailed] = 2
PlayerInfo[playerid][pJailTime] = 60*60;
SetPlayerInterior(playerid6);
PlayerInfo[playerid][pInt] = 6;
SetPlayerPos(playerid264.6288,77.5742,1001.0391);
SetPlayerWorldBounds(playerid264.6288,77.5742,1001.0391,1798.7453);

so , i want to get the Name of the player who has been kicked and say:
%s cuffed and Disconnect, 60Min Jail and -4500$ (i want someone helping me to create it )

i used Format but i get Erros for Undefinned symbole String,
So , if anyone can Create it for me should be better Thanks.


Re: Help with Format/String - henry jiggy - 05.10.2011

I posted some help on that old topic of yours. go look for it. btw all you need to do is:

pawn Код:
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
new String[200];
format(String, sizeof(String), "%s() Disconnected while Cuffed!,Punishments: 60Min Jail and -4500$",Name,playerid);



Re: Help with Format/String - ServerScripter - 05.10.2011

it will be like this ?
PHP код:
public OnPlayerDisconnect(playeridreason)
{
new 
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
new 
String[200];
if(
PlayerCuffed[playerid] == 2)
{
SafeGivePlayerMoney(playerid, -4500);
PlayerInfo[playerid][pJailed] = 2
PlayerInfo[playerid][pJailTime] = 60*60;
SetPlayerInterior(playerid6);
PlayerInfo[playerid][pInt] = 6;
SetPlayerPos(playerid264.6288,77.5742,1001.0391);
SetPlayerWorldBounds(playerid264.6288,77.5742,1001.0391,1798.7453);
format(Stringsizeof(String), "%s() Disconnected while Cuffed!,Punishments: 60Min Jail and -4500$",Name,playerid);




Re: Help with Format/String - Tigerkiller - 05.10.2011

you formated it but dont send it
use this under format:
SendClientMessageToAll(color,String);

replace color with your color or given error


Re: Help with Format/String - ServerScripter - 05.10.2011

thanks but i'm using
Код:
BroadCast(COLOR_RED,string);
is better


Re: Help with Format/String - Tigerkiller - 05.10.2011

np did it work now ?


Re: Help with Format/String - ServerScripter - 05.10.2011

Fixed+ Working thanks all