/contract fix.
#7

Now this may work -
pawn Код:
CMD:contract ( playerid , params[] )
{
    if(playerVariables[playerid][pAdminDuty] == 1) return SendClientMessage(playerid, COLOR_RED, "You can not contract somebody while on administrator duty.");
    new Contract , CPrice , CReason[128];
    if ( sscanf ( params , "uis[128]" , Contract , CPrice , CReason ) ) return SendClientMessage ( playerid , -1 , "Usage: /contract [ID] [Price] [Reason]" ) ;
    if ( !IsPlayerConnected ( Contract ) ) return SendClientMessage ( playerid , -1 , "Invalid ID" ) ;
    if ( Contract == playerid ) return SendClientMessage ( playerid , -1 , "You cannot contract yourself" ) ;
    if ( !playerVariables[playerid][pGroup] == 10 ) return SendClientMessage ( playerid , COLOR_RED , "The player your trying to hire is not a hitman." ) ;
    else
    {
    playerVariables[contracted][pContracted] = 1;
    new str[128];
    new str2[128];
    new CName[MAX_PLAYER_NAME] , DName[MAX_PLAYER_NAME];
    GetPlayerName ( Contract , CName , MAX_PLAYER_NAME ) ;
    GetPlayerName ( playerid , DName , MAX_PLAYER_NAME ) ;
    format ( str , 128 , "You have contracted %s for %i . Reason : %s" , CName , CPrice , CReason ) ;
    SendClientMessage ( playerid , -1 , str ) ;
    format ( str2 , 128 , "Somebody has requested a contract on %s for %i . Reason : %s ((If the reason isn't valid, ignore the contract.))" , DName , CPrice , CReason ) ;
    SendClientMessage ( Contract , -1 , str2 ) ;
    }
    return 1;
}
Warning : The code i am giving you are not tested as i am out from my home and currently on low internet so cant test it. But may work properly.
Reply


Messages In This Thread
/contract fix. - by Jack.7331 - 16.03.2012, 17:15
Re: /contract fix. - by Lil-D - 16.03.2012, 17:17
AW: /contract fix. - by Blunt P - 16.03.2012, 17:18
Re: AW: /contract fix. - by Jack.7331 - 16.03.2012, 17:35
Re: /contract fix. - by Ronaldo_raul™ - 16.03.2012, 18:08
Re: /contract fix. - by Jack.7331 - 16.03.2012, 18:42
Re: /contract fix. - by Ronaldo_raul™ - 17.03.2012, 08:47

Forum Jump:


Users browsing this thread: 5 Guest(s)