28.10.2010, 21:13
pawn Код:
command(agivevehiclelicense, playerid, params[])
{
new id, string [128];
if( sscanf( params, "u", id) )
{
if( Player[playerid][AdminLevel] >= 3 )
{
SendClientMessage( playerid, SYNTAXMSG, "SYNTAX: /agivevehiclelicense [playerid]" );
}
else
{
SendClientMessage( playerid, SYNTAXMSG, "You are not authorized to use that command." );
}
}
else
{
if( Player[playerid][AdminLevel] >= 3 )
{
if( IsPlayerConnectedEx( id ) )
{
if( Player[id][License] == 0 )
{
format( string, sizeof( string ), "You has been given a vehicle license by administrator %s.", GetName( playerid ) );
SendClientMessage( id, WHITE, string );
format( string, sizeof( string ), "You gave %s a gehivle license.", GetName( id ) );
SendClientMessage( playerid, WHITE, string );
Player[id][License] = 1;
}
else
{
SendClientMessage( playerid, SYNTAXMSG, "That player is already in possesion of a valid license." );
}
}
else
{
SendClientMessage( playerid, SYNTAXMSG, "That player is not connected / logged in." );
}
else
{
SendClientMessage( playerid, SYNTAXMSG, "You are not authroized to use that command." );
}
}
return 1;
}