Convert this into ZCMD.
#1

I need someone to convert from strcmp to zcmd (cmd). I have some troubles i try but i failed so i wanna see the correct. Thanks.


pawn Код:
if(strcmp(cmd, "/sladoled", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] != 26)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You dont have the job!");
                return 1;
            }
            new tmpcar = GetPlayerVehicleID(playerid);
            if(IsASladCar(tmpcar))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "HELP: /sladoled [playerid/PartOfName] [cjena]");
                    return 1;
                }
                new money;
                giveplayerid = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp)) { return 1; }
                money = strval(tmp);
                if(money < 1 || money > 50)
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Price cant be lower than 1$ or more than!");
                    return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid)
                            {
                                SendClientMessage(playerid, COLOR_GREY, "   You cant give a icecream to yourself !");
                                return 1;
                            }
                            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "* You sold an iceccream to %s for $%d.", giveplayer, money);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "* IceMan %s wants to sell you a $%d, (typej /accept sladoled) to accept.", sendername, money);
                            SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                            IceCreamOffer[giveplayerid] = playerid;
                            IceCreamPrice[giveplayerid] = money;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   The player is not near you!");
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   The player is offline.!");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not in a Ice-cream Truck.");
                return 1;
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Convert this into ZCMD. - by GBLTeam - 26.12.2013, 13:44
Re: Convert this into ZCMD. - by Jstylezzz - 26.12.2013, 13:50
Re: Convert this into ZCMD. - by ikey07 - 26.12.2013, 13:53
Re: Convert this into ZCMD. - by Pottus - 26.12.2013, 13:53
Re: Convert this into ZCMD. - by Hansrutger - 26.12.2013, 13:58
Re: Convert this into ZCMD. - by Vince - 26.12.2013, 14:37

Forum Jump:


Users browsing this thread: 2 Guest(s)