Need little help
#1

guyz i have a problem with a cmd i made tow cmds 1 /givemark and /showmarks
/givemark works perfect but /showmarks have a prob if i type /showmarks 0
then its show this player got 91 role play marks please help me and fix the /showmarks cmd
here is the code of those cmds

1-/givemark
pawn Код:
if(strcmp(cmd, "/givemark", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /givemark [playerid/PartOfName] [amount of marks]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp))
                    {
                            SCM(playerid, COLOR_GRAD1, "USAGE: /givemark [playerid/PartOfName] [amount of marks]");
                            return 1;

                    }
                    new amount;
                    amount = strval(tmp);
                    if (PlayerInfo[playerid][pTeacher] >= 1)
                    {
                        PlayerInfo[giveplayerid][pMarks] = amount;
                        GetPlayerName(playerid, numewarning, sizeof(numewarning));
                        format(string, sizeof(string), "[Teacher]: %s Has give you %d Roleplay mark(s).",numewarning,amount,giveplayerid);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                    }
                    else
                    {
                        SCM(playerid, COLOR_RED, "   You are not a RolePlay Teacher!");
                    }
                }//not valid id
            }//not connected
        }
        return 1;
    }
2-/showmarks
pawn Код:
if(strcmp(cmd, "/showmarks", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /showmarks [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new amount;
                    amount = strval(tmp);
                    PlayerInfo[giveplayerid][pMarks] = amount;
                    GetPlayerName(playerid, numewarning, sizeof(numewarning));
                    format(string, sizeof(string), "This Player Has %d Roleplay mark(s).",numewarning,amount,giveplayerid);
                    ABroadCast(COLOR_LIGHTRED,string, 5);
                }//not valid id
            }//not connected
        }
        return 1;
    }
Reply
#2

Код:
if(strcmp(cmd, "/showmarks", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /showmarks [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new amount;
                    amount = strval(tmp);
                    PlayerInfo[giveplayerid][pMarks] = amount;
                    GetPlayerName(playerid, numewarning, sizeof(numewarning));
                    format(string, sizeof(string), "%s Has %d Roleplay mark(s) to %s.",numewarning,amount,giveplayerid);
                    ABroadCast(COLOR_LIGHTRED,string, 5);
                }//not valid id
            }//not connected
        }
        return 1;
    }
try this !
Reply
#3

Not works
Reply
#4

OR
Код:
if(strcmp(cmd, "/showmarks", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /showmarks [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new amount;
                    amount = strval(tmp);
                    PlayerInfo[giveplayerid][pMarks] = amount;
                    GetPlayerName(playerid, numewarning, sizeof(numewarning));
                    format(string, sizeof(string), "This Player Has %d Roleplay mark(s).",amount);
                    ABroadCast(COLOR_LIGHTRED,string, 5);
                }//not valid id
            }//not connected
        }
        return 1;
    }
Reply
#5

now says this player have 0 rp marks but i have 7
Reply
#6

Код:
if(strcmp(cmd, "/showmarks", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /showmarks [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new amount;
                    amount = strval(tmp);
                    PlayerInfo[giveplayerid][pMarks] = amount;
                    GetPlayerName(playerid, numewarning, sizeof(numewarning));
                    format(string, sizeof(string), "This Player Has %d Roleplay mark(s).", PlayerInfo[giveplayerid][pMarks]);
                    ABroadCast(COLOR_LIGHTRED,string, 5);
                }//not valid id
            }//not connected
        }
        return 1;
    }
try this
Reply
#7

Nope Same prob ;(
Reply
#8

add id cubase.samp and you give me teamviewer and i help you in 20minutes (messenger)
Reply
#9

If you have skype the add me shehrozassad
Reply
#10

Ok thanks for help now finally i create correct code

pawn Код:
if(strcmp(cmd, "/showmarks", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SCM(playerid, COLOR_GRAD1, "USAGE: /showmarks [playerid/PartOfName]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if (PlayerInfo[playerid][pMarks] >= 1)
                    {
                        GetPlayerName(playerid, numewarning, sizeof(numewarning));
                        format(string, sizeof(string), "This Player have %d Roleplay mark(s).", PlayerInfo[playerid][pMarks]);
                        ABroadCast(COLOR_LIGHTRED,string, 5);
                    }
                    else
                    {
                        SCM(playerid, COLOR_RED, "   You Didn't have rp marks!");
                    }
                    format(string, sizeof(string), "You showed you'r RolePlay Marks to %s",numewarning);
                    ABroadCast(COLOR_LIGHTRED,string, 5);
                }//not valid id
            }//not connected
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)