help[+rep]
#1

hello i want some help a command /duty

when a player does /duty his skin gets changed to the cop skin,and now when he wants to go off duty he types /offduty he gets back his skin which he had before going on duty
Reply
#2

pawn Код:
OnPlayerCommandText(blag blaf)
{
    if(!strcmp("/duty",cmdtext,true,4)){
    SetPlayerSkin(playerid,POLICEMANSKIN_ID);
    return 1;
    }
    if(!strcmp("/offduty",cmdtext,true, 7)){
    SetPlayerSkin(playerid,PLAYERSKIN_ID);
    return 1;
    }
}
Skins find at samp-wiki
Reply
#3

CMD:duty(playerid, params[ ])
{
SetPlayerSkin(playerid,copskin);
return 1;
}
Reply
#4

pawn Код:
new OnDuty[MAX_PLAYERS];
new OffDutySkin[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
OnDuty[playerid] = 0;
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/duty", true) == 0)
    {
        if(OnDuty[playerid] == 0)
        {
        OffDutySkin[playerid] = GetPlayerSkin(playerid);
        SetPlayerSkin(playerid, 280); //Change 280 to whatever Skin ID you want for a cop.
        SendClientMessage(playerid, 0x00FF00AA, "You are now ON duty.");
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "You are already on duty!");
        return 1;
    }
   
    if(strcmp(cmdtext, "/offduty", true) == 0)
    {
        if(OnDuty[playerid] == 1)
        {
        SetPlayerSkin(playerid, OffDutySkin[playerid]);
        SendClientMessage(playerid, 0x00FF00AA, "You are now OFF duty.");
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "You are already off duty!");
        return 1;
    }
    return 1;
}
Reply
#5

that didnt help at all i want the skin which he had before going on duty


supose i have skin no.101 i go to lspd and type /duty i get the skin number 280,and now when i do /offduty i get back skin no.101

in short i need the same skin which i had before going on duty.
Reply
#6

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
new OnDuty[MAX_PLAYERS];
new OffDutySkin[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
OnDuty[playerid] = 0;
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/duty", true) == 0)
    {
        if(OnDuty[playerid] == 0)
        {
        OffDutySkin[playerid] = GetPlayerSkin(playerid);
        SetPlayerSkin(playerid, 280); //Change 280 to whatever Skin ID you want for a cop.
        SendClientMessage(playerid, 0x00FF00AA, "You are now ON duty.");
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "You are already on duty!");
        return 1;
    }
   
    if(strcmp(cmdtext, "/offduty", true) == 0)
    {
        if(OnDuty[playerid] == 1)
        {
        SetPlayerSkin(playerid, OffDutySkin[playerid]);
        SendClientMessage(playerid, 0x00FF00AA, "You are now OFF duty.");
        }
        else return SendClientMessage(playerid, 0xFF0000AA, "You are already off duty!");
        return 1;
    }
    return 1;
}
That is exactly what you said.
Reply
#7

yeah i know i couldnt post back to claren Thanks claren thanks very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)