How to convert this to zcmd
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], tmp[128], idx, glasseid, skin, id;
    cmd = strtok(cmdtext, idx);
   
    if(!strcmp("/glasses",cmd,true))
    {
        tmp = strtok(cmdtext, idx);
        skin = GetPlayerSkin(playerid);
        id = strval(tmp);
       
        if(!id || id > 33) return SendClientMessage(playerid, 0xFFFFFFAA, "(Error) Syntax: /glasses [1 - 33]");

        TextDrawShowForPlayer(playerid, MsgBox);
        SetTimerEx("Hide", 3500, false, "d", playerid);

        if(id > 30) goto PutPoliceGlasses;
        else
        {
            id--;
            glasseid =  CommonRed + id;
            SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
            return 1;
        }

        PutPoliceGlasses:

        glasseid = CopGlassesBlack + (id - 31);
        SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], floatadd(SkinOffSet[skin][1], 0.004500), SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
        return 1;
    }
    if(!strcmp("/remove",cmd,true))
    {
        StopPlayerHoldingObject(playerid);
        TextDrawSetString(MsgBox,"   Sunglasses removed");
        TextDrawShowForPlayer(playerid, MsgBox);
        TextDrawSetString(MsgBox,"   Sunglasses placed");
        return 1;
    }
    return 0;
}
title says all
Reply
#2

pawn Код:
CMD:glasses(playerid, o[])
{
    new id, skin, glasseid;
    if(sscanf(o,"i", id)) return SendClientMessage(playerid, 0xFFFFFAA,"(Error) Syntax: /glasses [1 - 33]");
    if(!id || id > 33) return SendClientMessage(playerid, 0xFFFFFFAA, "(Error) Syntax: /glasses [1 - 33]");
    skin = GetPlayerSkin(playerid);
    TextDrawShowForPlayer(playerid, MsgBox);
    SetTimerEx("Hide", 3500, false, "d", playerid);
    if(id > 30) goto PutPoliceGlasses;
    else
    {
        id--;
        glasseid =  CommonRed + id;
        SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
        return 1;
    }
    PutPoliceGlasses;
    glasseid = CopGlassesBlack + (id - 31);
    SetPlayerHoldingObject(playerid, glasseid, 2, SkinOffSet[skin][0], floatadd(SkinOffSet[skin][1], 0.004500), SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
    return 1;
}
CMD:remove(playerid, o[])
{
    #pragma unused o
    StopPlayerHoldingObject(playerid);
    TextDrawSetString(MsgBox,"   Sunglasses removed");
    TextDrawShowForPlayer(playerid, MsgBox);
    TextDrawSetString(MsgBox,"   Sunglasses placed");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)