Not performing correctly (Commands)
#1

Edit: Thanks SickAttack, Kaliber and Jefff for solving this problem. I have chosen the best solution to my problem. Use it if you need it.

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Problem was in <= MAX_PLAYER_NAME should be < MAX_PLAYER_NAME but here you go better
pawn Код:
InGameChatRemoveUnderscore(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = strlen(name)-1; i > -1; i--)
        if(name[i] == '_')
            name[i] = ' ';

    return name;
}


Hi guys!

Haven't use samp servers for a while now and wanted to update my gamemode a bit.
The thing is, my commands stopped working(not all of them).

Things I remember I have done:
- Updated ZCMD to I-ZCMD
- Updated to PlayerPoolSize and VehiclePoolSize , new functions in 0.3.7


I reverted to ZCMD and some of the for(new... loops back to basic ones.


When I type this command, it returns me -Command not recognized-
pawn Код:
CMD:b(playerid, params[])
{
    new string[128];
    if(isnull(params)) return SCM(playerid,LIGHTBLUE,"Use: {FFFFFF}/b [text]");
    format(string, sizeof(string), "%s: (( %s ))",InGameChatRemoveUnderscore(playerid),params);
    ProxDetector(25.0, playerid, string, COLOR_WHITE);
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, LIGHTBLUE, "Las Vegas: Origins -{FFFFFF} Command not recognized, use {33CCFF}/help" );
    return 1;
}


forward ProxDetector(Float:radi, playerid, string[],color);
public ProxDetector(Float:radi, playerid, string[],color)
{
    if(PlayerInfo[playerid][Logged] == false) return 1;
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && PlayerInfo[i][Logged] == true)
        {
            SendClientMessage(i,color,string);
        }
    }
    return 1;
}
For example, my command /makebiz works perfectly, while /givemoney will give me money, but will send me a message "Command not recognized".

Yeah, I really don't know what I have done hahaha. Maybe ZCMD, SSCANF2?

pawn Код:
CMD:givemoney(playerid, params[])
{
        if(PlayerInfo[playerid][AdminLevel] < HEAD_ADMIN) return SendClientMessage(playerid, COLOR_NICERED, "Denied!");
        new id,money;
        if(sscanf(params, "ui",id,money)) return SendClientMessage(playerid, LIGHTBLUE, "Use:{FFFFFF} /givemoney [ID Player] [Money]");
        if(PlayerInfo[id][Logged] == false) return SCM(playerid, COLOR_ERROR,"That player is Offline!");
        if(id == INVALID_PLAYER_ID)return SCM(playerid,COLOR_ERROR,"Wrong ID!");
        GiveHimMoney(id, money);
        new str[100];
        format(str,sizeof(str),"You gave{FFFFFF} %s  {00C0FF}$%d",InGameChatRemoveUnderscore(id), money);
        SendClientMessage(playerid,LIGHTBLUE,str);
        format(str,sizeof(str),"Admin {FFFFFF} %s gave you {00C0FF}$%d ",InGameChatRemoveUnderscore(playerid),money);
        SendClientMessage(id,LIGHTBLUE,str);
        return 1;
}
Reply


Messages In This Thread
[SOLVED]Not performing correctly (Commands) - by Sime30 - 06.07.2015, 15:25
Re: Not performing correctly (Commands) - by SickAttack - 06.07.2015, 15:39
Re: Not performing correctly (Commands) - by JaydenJason - 06.07.2015, 15:42
Re: Not performing correctly (Commands) - by Sime30 - 06.07.2015, 15:44
Re: Not performing correctly (Commands) - by SickAttack - 06.07.2015, 15:45
Re: Not performing correctly (Commands) - by Sime30 - 06.07.2015, 15:57
Re: Not performing correctly (Commands) - by Sime30 - 06.07.2015, 20:16
Re: Not performing correctly (Commands) - by SickAttack - 06.07.2015, 22:14
Re: Not performing correctly (Commands) - by Sime30 - 06.07.2015, 22:30
AW: Not performing correctly (Commands) - by Kaliber - 06.07.2015, 22:44

Forum Jump:


Users browsing this thread: 1 Guest(s)