16.03.2012, 09:13
After reading your post three times, i came to a conclusion that you want a command that can jail wanted persons.
So, this is easy and can be done by sscanf
Command :
So, this is easy and can be done by sscanf
Command :
pawn Код:
CMD:jail ( playerid , params [] )
{
if ( !IsPlayerAdmin ( playerid ) ) return SendClientMessage ( playerid , -1 , "Your not admin! Dumbass" ) ;
new TargetID , Reason[128];
if ( sscanf ( params , "us[128]" , TargetID , Reason ) ) return SendClientMessage ( playerid , -1 , "Usage : /jail [ID] [REASON]" ) ;
if( !IsPlayerConnected ( TargetID ) ) return SendClientMessage ( playerid , -1 , "Invalid ID" ) ;
if ( TargetID == playerid ) return SendClientMessage ( playerid , -1 , "You cannot jail yourself" ) ;
else
{
//SetPlayerPos(player , Float:x , Float:y , Float:z ) ;
new pName[MAX_PLAYER_NAME] , IDName[MAX_PLAYER_NAME];
GetPlayerName ( playerid , pName , MAX_PLAYER_NAME ) ;
GetPlayerName ( TargetID , IDName , MAX_PLAYER_NAME ) ;
new str[128];
format ( str , 128 , "%s Has been Jailed by Administrator %s. [Reason : %s ]" , IDName , pName , Reason ) ;
SendClientMessageToAll ( -1 , str ) ;
new str2[128];
format ( str2 , 128 , "You have been Jailed by Administrator %s. [Reason : %s ]" , pName , Reason ) ;
SendClientMessage ( TargetID , -1 , str2 ) ;
}
return 1;
}