17.03.2012, 08:47
Now this may work -
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.
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;
}