Correct cmds plz ^^
#1

I search the whole sa-mp website for these cmds ... but it's not working ... i mean ... just correct them without any includes and admin levels, because i dont need admin levels in my server ^^

pawn Код:
if(strcmp(cmd, "/akill", true) == 0)
    {
        if(level <= 3) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /akill [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        SetPlayerHealth(strval(cmd),0);
        format(tmp,sizeof(tmp),"* You have successfully e-killed %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just e-killed you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/goto", true) == 0)
    {
        if(level <= 3) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /goto [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported to %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported to your head!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/gethere", true) == 0)
    {
        if(level <= 3) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /gethere [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported %s to you.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported you to him! Get it on!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/slap", true) == 0)
    {
        if(level <= 3) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /slap [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+30);
        format(tmp,sizeof(tmp),"* You have successfully slapped %s out of the sky!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just slapped you from your position!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/mute", true) == 0)
    {
        if(level <= 1) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /mute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 1;
        format(tmp,sizeof(tmp),"* You have successfully muted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has muted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/unmute", true) == 0)
    {
        if(level <= 1) return 0; //must delete ! (dont have admin levels !!)
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /unmute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 0;
        format(tmp,sizeof(tmp),"* You have successfully unmuted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has unmuted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/explode", true) == 0)
    {
        if(pInfo[playerid][Logged] != 1)
            return 0;
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /explode [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        CreateExplosion(Pos[0],Pos[1],Pos[2],1,40);
        format(tmp,sizeof(tmp),"* You blew %s into a pixillion pieces!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has blown you to pixillion pieces!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
BTW: i have tried to correct them, but i get errors then ...

plz reply and fixx plzzz ;pp
Reply
#2

try this

pawn Код:
new x;
    new cmd[256];
    new tmp[256];
   
   
    if(strcmp(cmdtext, "/akill", true) == 0)
    {
       
        new Name[MAX_PLAYER_NAME];
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /akill [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        SetPlayerHealth(strval(cmd),0);
        format(tmp,sizeof(tmp),"* You have successfully e-killed %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just e-killed you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/goto", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /goto [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported to %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported to your head!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/gethere", true) == 0)
    {
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /gethere [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported %s to you.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported you to him! Get it on!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/slap", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /slap [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+30);
        format(tmp,sizeof(tmp),"* You have successfully slapped %s out of the sky!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just slapped you from your position!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/mute", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /mute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 1;
        format(tmp,sizeof(tmp),"* You have successfully muted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has muted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/unmute", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /unmute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 0;
        format(tmp,sizeof(tmp),"* You have successfully unmuted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has unmuted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/explode", true) == 0)
    {
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /explode [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        CreateExplosion(Pos[0],Pos[1],Pos[2],1,40);
        format(tmp,sizeof(tmp),"* You blew %s into a pixillion pieces!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has blown you to pixillion pieces!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    return 0;
Reply
#3

Quote:
Originally Posted by Mr.Stranger
Посмотреть сообщение
try this

pawn Код:
new x;
    new cmd[256];
    new tmp[256];
   
   
    if(strcmp(cmdtext, "/akill", true) == 0)
    {
       
        new Name[MAX_PLAYER_NAME];
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /akill [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        SetPlayerHealth(strval(cmd),0);
        format(tmp,sizeof(tmp),"* You have successfully e-killed %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just e-killed you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/goto", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /goto [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported to %s.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported to your head!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/gethere", true) == 0)
    {
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /gethere [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+5);
        format(tmp,sizeof(tmp),"* You have successfully teleported %s to you.",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just teleported you to him! Get it on!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/slap", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /slap [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]+30);
        format(tmp,sizeof(tmp),"* You have successfully slapped %s out of the sky!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has just slapped you from your position!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/mute", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /mute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 1;
        format(tmp,sizeof(tmp),"* You have successfully muted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has muted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    if(strcmp(cmd, "/unmute", true) == 0)
    {
       
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /unmute [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return SendClientMessage(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        pInfo[strval(cmd)][Mute] = 0;
        format(tmp,sizeof(tmp),"* You have successfully unmuted %s!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has unmuted you!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }

    if(strcmp(cmd, "/explode", true) == 0)
    {
       
        cmd = strtok(cmdtext, x);
        if(!strlen(cmd))
            return SendClientMessage(playerid, 0x887700AA, "* Syntax: /explode [playerid]");
        if(!IsNumeric(cmd) || !IsPlayerConnected(strval(cmd)))
            return RtnError(playerid, 0xFF0000AA, "* Jinkies! You entered an invalid playerid dude!");
        new Float:Pos[3];
        GetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(strval(cmd),Pos[0],Pos[1],Pos[2]);
        CreateExplosion(Pos[0],Pos[1],Pos[2],1,40);
        format(tmp,sizeof(tmp),"* You blew %s into a pixillion pieces!",Name(strval(cmd)));
        SendClientMessage(playerid,0x119900AA,tmp);
        format(tmp,sizeof(tmp),"* Admin[%s] has blown you to pixillion pieces!",Name(playerid));
        SendClientMessage(strval(cmd),0x119900AA,tmp);
        GameTextForPlayer(playerid,"~g~Success",4000,6);
        return 1;
    }
    return 0;
Ty but:
Код:
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(459) : warning 219: local variable "Name" shadows a variable at a preceding level
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(460) : error 017: undefined symbol "strtok"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(460) : error 033: array must be indexed (variable "cmd")
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(463) : error 017: undefined symbol "IsNumeric"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(466) : error 012: invalid function call, not a valid address
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(466) : error 001: expected token: ";", but found ")"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(466) : error 029: invalid expression, assumed zero
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(466) : fatal error 107: too many error messages on one line

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


7 Errors.
Reply
#4

Add This at the end of your script:


pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
 
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}


pawn Код:
stock IsNumeric(const string[]) {
    new length=strlen(string);
    if (length==0) return false;
    for (new i = 0; i < length; i++) {
        if (
        (string[i] > '9' || string[i] < '0' && string[i]!='-' && string[i]!='+')
        || (string[i]=='-' && i!=0)                                             //
        || (string[i]=='+' && i!=0)                                             //
        ) return false;
    }
    if (length==1 && (string[0]=='-' || string[0]=='+')) return false;
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)