SetPlayrClass(playerid, classid) help?
#1

Hello and i was just wondering if anyone knows how to fix my problem. my problem is when i type /buyclothes it and then select the class I want, it doesn't set the class it just keeps it as cj, but i want it to change to a specific class.. how?

pawn Код:
#include <a_samp>
#include <zcmd>

new spawn[MAX_PLAYERS];
new classselection[MAX_PLAYERS];

public OnGameModeInit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    spawn[playerid] = 1;
    SetSpawnInfo(playerid, 0, 0, -1514.9274,2525.9253,55.7668, 12.5629, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnPlayerRequestClass(playerid)
{
    if(spawn[playerid] == 1)
    {
        SpawnPlayer(playerid);
    }
    if(classselection[playerid] == 1)
    {
        SetPlayerPos(playerid,2480.3538,1870.8656,24.3753);
        SetPlayerCameraPos(playerid,2473.7202,1870.9253,25.7971);
        SetPlayerCameraLookAt(playerid,2480.3538,1870.8656,24.3753);
        SetPlayerFacingAngle(playerid,86.9258);
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(classselection[playerid] == 1)
    {
        GivePlayerMoney(playerid, -1000);
    }
    classselection[playerid] = 0;
    return 1;
}

CMD:buyclothes(playerid, params[])
{
    if(classselection[playerid] == 0)
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Clothes", "Hobo", "Okay", "");
        SetSpawnInfo(playerid, 0, 0, -1514.9274,2525.9253,55.7668, 12.5629, 0, 0, 0, 0, 0, 0);
        classselection[playerid] = 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "You are already in the clothes shop!");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            if(response)
            {
                SendClientMessage(playerid, -1, "You have changed your clothes!");
                SpawnPlayer(playerid);
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerSkin(playerid, 1);
                }
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
SetPlayrClass(playerid, classid) help? - by BigAl - 24.09.2011, 16:06
Re: SetPlayrClass(playerid, classid) help? - by Backwardsman97 - 24.09.2011, 16:25
Re: SetPlayrClass(playerid, classid) help? - by N.K.Stallone - 24.09.2011, 16:26
Re: SetPlayrClass(playerid, classid) help? - by CmZxC - 24.09.2011, 16:33
Re: SetPlayrClass(playerid, classid) help? - by N.K.Stallone - 24.09.2011, 16:44
Re: SetPlayrClass(playerid, classid) help? - by Kaperstone - 24.09.2011, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)