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



color - Kar - 10.06.2010

anyone kknow this color's id?



Uploaded with ImageShack.us

SetTimer("PingCheck",1000*10,1);

whats timer for 30 seconds?


Re: color - Nero_3D - 10.06.2010

pawn Код:
SetTimer("PingCheck", 1000 * 30, true);
And the color is 0xE100E1AA


Re: color - Kar - 10.06.2010

thx but now i got a another prob

format(string,sizeof(string),"%s Has Been Kicked From The Server. (Reason: High Ping)");

this doesn't send the person's name.. weird... it just leavwes a blank space and says Has Been kicked from the server etc..

[edit]
Код:
SetTimer("PingCheck", 1000 * 30, true);
30 means 30 seconds? 10 means 10 secs?


Re: color - Joe_ - 10.06.2010

https://sampwiki.blast.hk/wiki/Format

That tells you how to use it correctly (format)


Re: color - Assyria - 10.06.2010

For the timer guestion: 1000 * 30 means 30 multiplied by 1000, SetTimer uses milliseconds, so, 30 * 1000 is the same as 30000. ( 1000 milliseconds = 1 second. )


Re: color - Kar - 10.06.2010

Quote:
Originally Posted by Joe_
https://sampwiki.blast.hk/wiki/Format

That tells you how to use it correctly (format)
ya i can use it correctly heres the code..
Код:
public PingCheck()
{
for(new i=0; i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i,"IsSpawned") == 1)
{
if(GetPlayerPing(i) >= 1000)
{
new name[MAX_PLAYER_NAME],string[71];
GetPlayerName(i,name,sizeof(name));
format(string,sizeof(string),"%s Has Been Kicked From The Server. (Reason: High Ping)");
SendClientMessageToAll(PINK,string);
Kick(i);
}}}}
return 1;
}



Re: color - Nero_3D - 10.06.2010

You missed the parameter part {Float,_}:...

pawn Код:
public PingCheck()
{
  for(new i, string[71]; i != MAX_PLAYERS; i++)
    if((GetPVarInt(i, "IsSpawned") == 1) && (GetPlayerPing(i) >= 1000))
    {
      GetPlayerName(i, string, MAX_PLAYER_NAME);
      format(string, sizeof(string), "%s Has Been Kicked From The Server. (Reason: High Ping)", string);
      SendClientMessageToAll(PINK, string);
      Kick(i);
    }
}



Re: color - Jakku - 10.06.2010

Quote:
Originally Posted by Kar
this doesn't send the person's name.. weird... it just leavwes a blank space and says Has Been kicked from the server etc..
pawn Код:
new string[170];
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "%s has been kicked from the server (High Ping)",name);
SendClientMessageToAll(COLOR_COLOR,string);




Re: color - Niixie - 10.06.2010

pawn Код:
public PingCheck()
{
for(new i=0; i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i,"IsSpawned") == 1)
{
if(GetPlayerPing(i) >= 1000)
{
new name[MAX_PLAYER_NAME],string[71];
GetPlayerName(i,name,sizeof(name)); // 1
format(string,sizeof(string),"%s Has Been Kicked From The Server. (Reason: High Ping)", name); // Remember ", name)) to get %s changed to the info that "name" is holding, and its the playername. I marked the line where "name" is getting the playername as information with 1.
SendClientMessageToAll(PINK,string);
Kick(i);
}}}}
return 1;
}
There you go, Modifacation of your own code.


Re: color - Kar - 10.06.2010

thx all btw its fixed now