SA-MP Forums Archive
+Reps , how to (SMall help) - 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: +Reps , how to (SMall help) (/showthread.php?tid=482403)



+Reps , how to (SMall help) - MahdiGames - 20.12.2013

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 !


Re: +Reps , how to (SMall help) - xVIP3Rx - 20.12.2013

Use GetPlayerVersion and strcmp


Re: +Reps , how to (SMall help) - Tayab - 20.12.2013

pawn Код:
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);
}



Re: +Reps , how to (SMall help) - MahdiGames - 20.12.2013

Quote:
Originally Posted by Tayab
Посмотреть сообщение
pawn Код:
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;
      }
      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);
}
C:\Users\MaHdy\Desktop\SPA Server original\gamemodes\SPA.pwn(2236) : error 029: invalid expression, assumed zero
C:\Users\MaHdy\Desktop\SPA Server original\gamemodes\SPA.pwn(2236) : warning 215: expression has no effect
C:\Users\MaHdy\Desktop\SPA Server original\gamemodes\SPA.pwn(2236) : error 001: expected token: ";", but found ")"
C:\Users\MaHdy\Desktop\SPA Server original\gamemodes\SPA.pwn(2236) : error 029: invalid expression, assumed zero
C:\Users\MaHdy\Desktop\SPA Server original\gamemodes\SPA.pwn(2236) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


Re: +Reps , how to (SMall help) - MahdiGames - 20.12.2013

Please help !


Re: +Reps , how to (SMall help) - BlackWolf120 - 20.12.2013

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;
}
try this


Re: +Reps , how to (SMall help) - MahdiGames - 20.12.2013

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
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;
}
try this
You know this protecting ur server from bots attackers thanks. i will try


Re: +Reps , how to (SMall help) - Tayab - 20.12.2013

pawn Код:
if(strcmp(version,"0.3x",false))
    {
        KickWithMessage(playerid,"Please download the latest version of SA-MP");
        return 1;
    }
Fixed mine.