#1

anyone kknow this color's id?



Uploaded with ImageShack.us

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

whats timer for 30 seconds?
Reply
#2

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

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?
Reply
#4

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

That tells you how to use it correctly (format)
Reply
#5

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. )
Reply
#6

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;
}
Reply
#7

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

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);

Reply
#9

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

thx all btw its fixed now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)