20.12.2013, 22:26
Hello , how can i add msg that checks if the player running R1 SAMP , so if he running r1 0.3x he got auto kick reason please update ur samp !
public OnPlayerConnected(playerid)
{
new version[40];
GetPlayerVersion(playerid,version,sizeof(version));
if(strcmp(version,"0.3x",false)) == true)
{
KickWithMessage(playerid,"Please download the latest version of SA-MP");
}
return 1;
}
// If you don't have KickWithMessage, then copy this at the end of your .pwn file.
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
KickWithMessage(playerid, message[])
{
SendClientMessage(playerid, COLOR_RED, message);
SetTimerEx("KickPublic", 1000, 0, "d", playerid);
}
pawn Код:
|
public OnPlayerConnect(playerid)
{
new version[40];
GetPlayerVersion(playerid,version,sizeof(version));
if(strcmp(version,"0.3x",false)) == true)
{
KickForMessageDelay(playerid);
SendClientMessage(playerid, 0xFF0000FF, "Please download the latest version of SA-MP!");
}
return 1;
}
stock KickForMessageDelay(playerid)
{
SetTimerEx("AKick",500,false,"i",playerid);
return 1;
}
forward AKick(playerid);
public AKick(playerid)
{
Kick(playerid);
return 1;
}
pawn Код:
|
if(strcmp(version,"0.3x",false))
{
KickWithMessage(playerid,"Please download the latest version of SA-MP");
return 1;
}