SA-MP Forums Archive
Trans 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: Trans help (/showthread.php?tid=350235)



Trans help - N0FeaR - 11.06.2012

Is there any guide how i can trans strcmp(cmd to ZCMD? or i someone want to help me?


Re: Trans help - ReneG - 11.06.2012

Are you kidding me?

There is thousands of threads on zcmd. Don't be so lazy.

Second, do you actually want 'help' or you want slave work? If you want slavework post here.


Re: Trans help - N0FeaR - 11.06.2012

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Are you kidding me?

There is thousands of threads on zcmd. Don't be so lazy.

Second, do you actually want 'help' or you want slave work? If you want slavework post here.
Yes, i want help


Re: Trans help - N0FeaR - 11.06.2012

I give a ec a cmd i want to trans

pawn Код:
}
    if(strcmp(cmd, "/blindfold", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /blindfold [playerid/partofname]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(giveplayerid == playerid)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not blind yourself");
                    return 1;
                }
                if(PlayerCuffed[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not do this while cuffed");
                    return 1;
                }
                if(PlayerTazed[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not do this while tazed");
                    return 1;
                }
                if(PlayerTied[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can not do this while tied");
                    return 1;
                }
                if(PlayerTied[giveplayerid] == 1)
                {
                    if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SetPlayerCameraPos(giveplayerid, -833.5241,-1358.8575,86.9054);
                        PlayerPlayerActionMessage(playerid,giveplayerid,30.0, "takes out a rag and blindfolds");
                        Blindfold[giveplayerid] = SetTimerEx("BlindfoldTimer", 300000, 0, "i", giveplayerid);
                        return SetPlayerCameraLookAt(giveplayerid, -830.8118,-1360.3612,87.0289);
                    }
                    else
                    {
                        return SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
                    }
                }
                else if(PlayerCuffed[giveplayerid] == 1)
                {
                    if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5)
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        SetPlayerCameraPos(giveplayerid, -833.5241,-1358.8575,86.9054);
                        PlayerPlayerActionMessage(playerid,giveplayerid,30.0, "takes out a rag and blindfolds");
                        Blindfold[giveplayerid] = SetTimerEx("BlindfoldTimer", 300000, 0, "i", giveplayerid);
                        return SetPlayerCameraLookAt(giveplayerid, 2000,-2000,2000);
                    }
                    else
                    {
                        return SendClientMessage(playerid, COLOR_GREY, "That player is not in range");
                    }
                }
            }
            else
            {
                return SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid");
            }
        }
        return 1;



Re: Trans help - ReneG - 11.06.2012

Help on what?

https://sampforum.blast.hk/showthread.php?tid=319000
https://sampforum.blast.hk/showthread.php?tid=322311
https://sampforum.blast.hk/showthread.php?tid=327201

Those are just one of the many tutorials on ZCMD I found by literally searching "ZCMD Tutorials" on ******.

EDIT:

Barely saw your post.


Re: Trans help - N0FeaR - 11.06.2012

How should i trans this?

Код:
tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))



Re: Trans help - N0FeaR - 11.06.2012

Nvm, thanks for the guide man


Re: Trans help - ReneG - 11.06.2012

By using sscanf with zcmd.

sscanf splits up the command into variables for commands with multiple parameters.